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
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Write a program to swap two numbers without using third variable?
How to Throw some light on the splay trees?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
Why can’t constant values be used to define an array’s initial size?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Why is structure padding done in c?
all c language question
Sir i need notes for structure,functions,pointers in c language can you help me please
What is the purpose of & in scanf?
Where are c variables stored in memory?
Why is event driven programming or procedural programming, better within specific scenario?
Explain the difference between null pointer and void pointer.
What are the features of c languages?
How can I read data from data files with particular formats?