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

Programming Exercises

Write a function to calculate the factorial of a number (6) using recursion.

Medium

Problem Statement

Write a function to calculate the factorial of a number (6) using recursion.

Sample Input

6

Sample Output

Factorial of 6 is 720

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int factorial(int n) { // Your code here } int main() { int n = 6; 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
6
Expected Output
Factorial of 6 is 720