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

Programming Exercises

Find the factorial of each number in an array {4, 3, 2, 5}.

Medium

Problem Statement

Find the factorial of each number in an array {4, 3, 2, 5}.

Sample Input

4 3 2 5

Sample Output

24 6 2 120 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int factorial(int num) { // Your code here } int main() { int arr[] = {4, 3, 2, 5}; for (int i = 0; i < 4; i++) { printf("%d ", factorial(arr[i])); } printf("\n"); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
4 3 2 5
Expected Output
24 6 2 120