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();
}
Answers were Sorted based on User's Feedback
Answer / rama krishna sidhartha
Since there is no output statement in this program there
output will not be displayed.
The output statement must be as follows :
printf("%d",k);
Then the output will be 10.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / aditya
there is no print statement and hence there is no output.
If at all k is printed it will be 10.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
Is it cc or c in a letter?
what is the advantage of function pointer
16 Answers CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,
How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamically from a to z and do not print this using pgm like this print("Ab......"); Use loops or anything to print all alphabets
What is hashing in c?
wt is diference between int and int pointer as same as float and float pointer and char and char pointer
what is c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
write a program that explain #define and # undef directive
how can I convert a string to a number?
what is the difference between NULL & NUL keywords in C?
A program to write a number of letters and numbers, such as counting and display
What is use of null pointer in c?