Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Find the factorial of a number using iteration. Calculate factorial of 7.

Medium

Problem Statement

Find the factorial of a number using iteration. Calculate factorial of 7.

Sample Input

7

Sample Output

Factorial of 7 is 5040

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int factorial(int n) { // Your code here } int main() { int n = 7; printf("Factorial of %d is %d\n", n, factorial(n)); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
7
Expected Output
Factorial of 7 is 5040