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
Do you know the use of fflush() function?
What does c mean in basketball?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What are header files in c programming?
What is modeling?
What are the types of i/o functions?
If you know then define #pragma?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is meant by type casting?
What is sizeof return in c?
What is the difference between int main and void main?
What is the purpose of scanf() and printf() functions?
How can a program be made to print the line number where an error occurs?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....