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 |
What is string function c?
Why the below program throughs error during compilation? #include<stdio.h> #include<conio.h> enum { ZERO, ONE, TWO, }; main() { printf("%d",&TWO); getch(); }
Write a program of prime number using recursion.
What are formal parameters?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
using for loop sum 2 number of any 4 digit number in c language
Explain the difference between getch() and getche() in c?
Explain how does free() know explain how much memory to release?
any string of bits of length 'n' represents a unique non- negative integer between.............?
What is the difference between break and continue?
write a program in c to print **** * * * * ****
program to find a smallest number in an array