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
How can I get random integers in a certain range?
What is a memory leak? How to avoid it?
Is it better to use a macro or a function?
Do you have any idea about the use of "auto" keyword?
What does sizeof int return?
How do you use a 'Local Block'?
How can you return multiple values from a function?
What is assert and when would I use it?
Where does the name "C" come from, anyway?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
Write a program to show the change in position of a cursor using c
Write a program to swap two numbers without using a temporary variable?
Write a program to use switch statement.
hi, which software companys will take,if d candidate's % is jst 55%?
What is meant by preprocessor in c?