What is the output of the following progarm?
#include<stdio.h>
main( )
{
int x,y=10;
x=4;
y=fact(x);
printf(ā%d\nā,y);
}
unsigned int fact(int x)
{
return(x*fact(x-1));
}
A. 24
B. 10
C. 4
D. none
Answer Posted / venu
ans:D.
when x= 1, x-1 =0, so total value = 0;
in fact() they are not checking if x==1 && x==0.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
Do you know what are bitwise shift operators in c programming?
What is the difference between near, far and huge pointers?
Can you please explain the difference between exit() and _exit() function?
List out few of the applications that make use of Multilinked Structures?
What does the format %10.2 mean when included in a printf statement?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
Write a code to remove duplicates in a string.
Define macros.
What is a MAC Address?
how we can make 3d venturing graphics on outer interface
Why is void main used?
What is c token?
What is the auto keyword good for?
Why do we need arrays in c?
Explain data types & how many data types supported by c?