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


Please Help Members By Posting Answers For Below Questions

how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1209


What are called c variables?

569


What is a const pointer in c?

666


What is the explanation for the dangling pointer in c?

669


What is the difference between struct and typedef struct in c?

646






How we can insert comments in a c program?

625


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

726


Explain what are linked list?

615


why wipro wase

1823


What are the advantage of c language?

546


What's the best way of making my program efficient?

620


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2528


Difference between macros and inline functions? Can a function be forced as inline?

703


What is array of structure in c programming?

745


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

1853