main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}
Answer / susie
Answer :
5 4 3 2 1
Explanation:
When static storage class is given, it is
initialized once. The change in the value of a static
variable is retained even between the function calls. Main
is also treated like any other ordinary function, which can
be called recursively.
| Is This Answer Correct ? | 50 Yes | 22 No |
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }
String copy logic in one line.
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
how to swap 3 nos without using temporary variable
What is "far" and "near" pointers in "c"...?
How do you write a program which produces its own source code as its output?
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
write a c-program to find gcd using recursive functions
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .