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

Whats s or c mean?

1023


C language questions for civil engineering

1716


Explain can static variables be declared in a header file?

1150


What is oops c?

1237


How does free() know explain how much memory to release?

1052


Explain modulus operator.

1051


Wt are the Buses in C Language

3214


When should we use pointers in a c program?

1131


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

1084


Can you write the algorithm for Queue?

2108


What should malloc(0) do?

1116


What is queue in c?

1097


Write a code to generate a series where the next element is the sum of last k terms.

1224


What is 2 d array in c?

1021


Who is the main contributor in designing the c language after dennis ritchie?

999