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...

proc() {

static i=10;
printf("%d",i);
}

If this proc() is called second time, what is the output?

Answer Posted / sujith

I dont know how can it be 11 next time.
I agree that static variables are assigned only once, and
allocation is happening to the data segment, but it doesnt
mean that is going to change the value on its own, until u
do that manually.

U call this program for n times, the answer is going to be 10.

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %s and %d in c?

1107


What is volatile variable in c with example?

1089


Why cant I open a file by its explicit path?

1086


How can I use a preprocessorif expression to ?

1112


What is variable declaration and definition in c?

969


What is extern variable in c with example?

1056


How are strings stored in c?

1081


why return type of main is not necessary in linux

2151


What is header file definition?

1137


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2597


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1240


What is function pointer c?

1192


The difference between printf and fprintf is ?

1346


What is a pointer in c?

1695


What is a shell structure examples?

1148