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
Explain what is the difference between a string and an array?
Why do we use & in c?
What are the different types of C instructions?
Write a program to generate the Fibinocci Series
Explain enumerated types.
What is a pointer in c plus plus?
Is fortran faster than c?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
How can I make sure that my program is the only one accessing a file?
Why is c still so popular?
Explain Basic concepts of C language?
How to find a missed value, if you want to store 100 values in a 99 sized array?
How do you print an address?
I heard that you have to include stdio.h before calling printf. Why?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?