Answer Posted / sasi
Whenever Static is used with a Variable declaration .. it defines that the last updated value of the Variable will not be deleted after the process of a program .
Eg : #include <stdio.h>
int main() {
func();
func();
func();
}
void func() {
static int i=2;
i=i+1;
printf("%d
",i);
return 0;
}
Output :
3
4
5
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the advantage of c?
What does printf does?
Can we change the value of static variable in c?
how to write a c program to print list of fruits in alpabetical order?
write a c program in such a way that if we enter the today date the output should be next day's date.
Can you define which header file to include at compile time?
How many parameters should a function have?
Explain what is a pragma?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Are pointers really faster than arrays?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What are the types of bitwise operator?
Explain about the functions strcat() and strcmp()?
What is a volatile keyword in c?
What are the salient features of c languages?