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
Can include files be nested? How many levels deep can include files be nested?
Why does the call char scanf work?
What the different types of arrays in c?
How can I read data from data files with particular formats?
What are the two forms of #include directive?
Why doesnt the call scanf work?
write a program to display all prime numbers
What is the benefit of using const for declaring constants?
what will be maximum number of comparisons when number of elements are given?
What are qualifiers?
What are the features of c languages?
Do you know pointer in c?
Can you please explain the difference between malloc() and calloc() function?
How do we print only part of a string in c?
Write a program to reverse a linked list in c.