What are local and global variables?

Answer Posted / pushpendra

local variable:-its uses inside the function that is these variable exist inside the function and other fu no access out side the main function.
while global variables are variables and which are declared both sides of function inside and outside that is globally.all functions can access out of main function.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Compare and contrast compilers from interpreters.

679


Why is c still so popular?

614


Why does the call char scanf work?

611


Find MAXIMUM of three distinct integers using a single C statement

622


What is anagram in c?

511






What are the advantages and disadvantages of a heap?

700


Explain bitwise shift operators?

627


Which is more efficient, a switch statement or an if else chain?

573


What do you mean by scope of a variable in c?

540


What is dynamic variable in c?

560


What is #include stdio h?

677


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

650


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

664


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

615


What happens if you free a pointer twice?

604