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
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 difference between array,strutter,union and pointers
3 Answers CTS, Lovely Professional University, Mannar Company,
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output?
what does static variable mean?
What is structure padding ?
how to find anagram without using string functions using only loops in c programming
1 232 34543 4567654 can anyone tell me how to slove this c question
What is self-referential structure in c programming?
What is sparse file?
what is volatile in c language?
9 Answers Cap Gemini, HCL, Honeywell, TCS, Tech Mahindra,
Write code for initializing one dimentional and two dimentional array in a C Program?
5 Answers Deshaw, Edutech, GMD,
Can we declare function inside main?