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 |
How to swap 3 numbers without using 4th variable?
how to execute with out main in cprogram
What do you know about the use of bit field?
main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*
how many errors in c explain deply
There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?
What is the difference between typedef struct and struct?
Explain what does the format %10.2 mean when included in a printf statement?
How. To pass the entrance test
what is the difference between procedure oriented and object oriented progaming language
Write a program in C for showing working of different logical operator in C. Your program should guide users with proper message/menu on the console.
What is the difference between c &c++?