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 your stream meaning?

1150


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6766


Which of these functions is safer to use : fgets(), gets()? Why?

1062


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

1398


What does c value mean?

1129


What are the main characteristics of c language describe the structure of ac program?

1168


simple program of graphics and their output display

1958


Write a program to print fibonacci series using recursion?

1020


When should structures be passed by values or by references?

1010


What are preprocessor directives in c?

1057


What is substring in c?

1149


How can you tell whether two strings are the same?

1222


What is the Purpose of 'extern' keyword in a function declaration?

1049


The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.

1589


What is a structure and why it is used?

1152