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

How can I remove the leading spaces from a string?

0 Answers  


What are external variables in c?

0 Answers  


why TCS selected more student in the software field from all institution.

5 Answers   TCS,


how to find out the union of two character arrays?

2 Answers  


what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits

2 Answers   Wipro,


How can you tell whether a program was compiled using c versus c++?

0 Answers  


which header file contains main() function in c?

17 Answers   Google, HCL, TCS,


What is a null pointer in c?

0 Answers  


What is zero based addressing?

0 Answers  


what is c language?

2 Answers  


what r callback function?

1 Answers  


how to multiply two number taking input as a string (considering sum and carry )

2 Answers   Wipro,


Categories