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() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
void main() { int i=5; printf("%d",i++ + ++i); }
How to palindrom string in c language?
How to return multiple values from a function?
void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }
1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?
could you please send the program code for multiplying sparse matrix in c????
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,
Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?
Is the following code legal? typedef struct a { int x; aType *b; }aType
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }