What are Storage Classes in C ?
Answer Posted / ajith
#include<stdio.h>
void main()
{
int a,s; /*** local variable****/
printf("\n enter the value of a---");
scanf("%d",&a);
s=a+2;
printf("s=%d",a);
getch();
}
output--
enter the value of a--- 5
s=7
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
///*********************************////
| Is This Answer Correct ? | 70 Yes | 27 No |
Post New Answer View All Answers
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What is the return type of sizeof?
What is variable and explain rules to declare variable in c?
Can one function call another?
What is the function of multilevel pointer in c?
What are the restrictions of a modulus operator?
Why does notstrcat(string, "!");Work?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
What is pointer to pointer in c with example?
what is different between auto and local static? why should we use local static?
Write a c program to demonstrate character and string constants?
Explain what is the benefit of using const for declaring constants?
Not all reserved words are written in lowercase. TRUE or FALSE?
Why do we use return in c?