answersLogoWhite

0

Variables that the program can use everywhere in the program. Example:

int x = 5;

int main(void)

{

x = 6;

foo();

return 0;

}

void foo(void)

{

x = 5;

}

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
More answers
  • variables are named data areas that can change during the execution of the program
  • constants are named or unnamed data areas that are prohibited from changing during the execution of the program

If named variables and constants may appear indistinguishable in the code, but will be declared differently.

User Avatar

Wiki User

9y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What are global variables explain with examples?
Write your answer...
Submit
Still have questions?
magnify glass
imp