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 |
suppose there are five integers write a program to find larger among them without using if- else
Explain what is the difference between a string and an array?
what is call by value and call by reference
What are integer variable, floating-point variable and character variable?
How can draw a box in cprogram without using graphics.h header file & using only one printf(); ?
What is difference between && and & in c?
What is the difference between the local variable and global variable in c?
Do you know what is the purpose of 'extern' keyword in a function declaration?
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,
write a program to display numbers from 1 to 10 and 10 to 1?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
HOW TO HANDLE EXCEPTIONS IN C