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

Answers were Sorted based on User's Feedback



What is the output of the following progarm? #include<stdio.h> main( ) { int x..

Answer / 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

What is the output of the following progarm? #include<stdio.h> main( ) { int x..

Answer / kalyan chukka

A.24

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More C Interview Questions

What is a pointer in c plus plus?

0 Answers  


What does main () mean in c?

0 Answers  


What are the different categories of functions in c?

0 Answers  


What are header files and explain what are its uses in c programming?

0 Answers  


Explain how can I manipulate strings of multibyte characters?

0 Answers  






Here is a neat trick for checking whether two strings are equal

0 Answers  


How many keywords (reserve words) are in c?

0 Answers  


main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }

4 Answers   CitiGroup,


why we use "include" word before calling the header file. is there any special name for that include??????

1 Answers   TCS,


write a program to print the one dimensional array.

1 Answers  


#define d 10+10 main() { printf("%d",d*d); }

6 Answers  


write a program to print sum of each row of a 2D array.

4 Answers  


Categories