Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



what will be the output of the following program, justify? #define TEST int TEST getdata() { ..

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

what will be the output of the following program, justify? #define TEST int TEST getdata() { ..

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

what will be the output of the following program, justify? #define TEST int TEST getdata() { ..

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

Post New Answer

More C Interview Questions

When should a far pointer be used?

0 Answers   Aspire, Infogain,


why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?

2 Answers  


How does variable declaration affect memory?

1 Answers  


WAP to accept rollno,course name & marks of a student & display grade if total marks is above 200?

4 Answers  


WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS

4 Answers  


How to calculate sum

2 Answers  


What is Function Pointer? Explain with example?

3 Answers  


Is anything faster than c?

0 Answers  


Why we use void main in c?

0 Answers  


What is the difference between memcpy and memmove?

0 Answers  


Why main is used in c?

0 Answers  


What is the purpose of the statement: strcat (S2, S1)?

0 Answers  


Categories