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 structural principle?

0 Answers  


What is the use of keyword VOLATILE in C?

1 Answers  


When is an interface "good"?

1 Answers  


struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??

9 Answers   Verifone,


which is conditional construct a) if statement b) switch statement c) while/for d) goto

0 Answers  






how to print 212 as Twohundreds twelve plz provide me ans soon

1 Answers  


1,4,8,13,21,30,36,45,54,63,73,?,?.

10 Answers   AMB, Franklin Templeton,


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

0 Answers   Wilco,


How can I delete a file?

0 Answers  


i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


What is the difference between the = symbol and == symbol?

0 Answers  


What is the difference between volatile and const volatile?

0 Answers  


Categories