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
What are the application of c?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is an expression?
Can you write the function prototype, definition and mention the other requirements.
can anyone please tell about the nested interrupts?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
Why do we use int main?
How do you use a pointer to a function?
What does sizeof function do?
What are structure members?
What is difference between array and structure in c?
If errno contains a nonzero number, is there an error?
Why is c so important?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit