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
What is your stream meaning?
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)
Which of these functions is safer to use : fgets(), gets()? Why?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What does c value mean?
What are the main characteristics of c language describe the structure of ac program?
simple program of graphics and their output display
Write a program to print fibonacci series using recursion?
When should structures be passed by values or by references?
What are preprocessor directives in c?
What is substring in c?
How can you tell whether two strings are the same?
What is the Purpose of 'extern' keyword in a function declaration?
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.
What is a structure and why it is used?