Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures

What is the output of the following code? int fact(int n) { if(n == 0) return 1; return n * fact(n - 1); } int main() { int n = 1; int ans = fact(n); printf("%d",ans); return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • 1

Related Computer Questions

Which of the following is not a type of broadband Internet connection? Comments can be added to cells using ________ Which of the following is the correct extension of the Python file? Which of the following is not a valid way to declare a long variable in Java? What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input) #include <stdio.h> void main() { double ch; printf("enter a value between 1 to 2:"); scanf("%lf", &ch); switch (ch) { case 1: printf("1"); break; case 2: printf("2"); break; } }