What are Storage Classes in C ?
Answer Posted / veda
example of global variable----
#include<stdio.h>
int a; /***global variable*********/
void main()
{
int s;
printf("\n enter the value of a--");
scanf("%d",&a);
s=a+3;
printf("\n s=%d",a);
mul(); /****another function********/
getch();
void mul()
{
int m;
m=a*2;
printf("\n m=%d",a);
}
output---
enter the value of a----5
s=8
m=10
when u r compaing this program in lnux we get a waring
because in linux default type is integer so in calling
function we r giving void so internally compailer treate as
a int so,
here type declaration is impartent
| Is This Answer Correct ? | 21 Yes | 25 No |
Post New Answer View All Answers
Explain what is the most efficient way to store flag values?
What is data structure in c and its types?
What is null pointer in c?
What is function prototype in c with example?
Can a function argument have default value?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What are reserved words with a programming language?
What is the description for syntax errors?
How can you avoid including a header more than once?
What is this infamous null pointer, anyway?
What is multidimensional arrays
What is c++ used for today?
What tq means in chat?
Write a function that will take in a phone number and output all possible alphabetical combinations
What is #pragma statements?