what will be the output of the following program, justify?
#define TEST
int TEST getdata()
{
static i;
i+=10;
return i;
}
main()
{
int k;
k = getdata();
}
Answer Posted / rkr
The Static variable is initialized to zero
In the above program
static i; which is equivalent to static i = 0;
Next line i is incrementing by 10, then i value is 10.
return the value is 10
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
Can you think of a logic behind the game minesweeper.
Do you have any idea about the use of "auto" keyword?
how can f be used for both float and double arguments in printf? Are not they different types?
What is 1d array in c?
What is the acronym for ansi?
Are the expressions * ptr ++ and ++ * ptr same?
Does c have class?
What is build process in c?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is a memory leak? How to avoid it?
How can I manipulate strings of multibyte characters?
Are c and c++ the same?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
How is = symbol different from == symbol in c programming?