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
Is struct oop?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
What is page thrashing?
What are local static variables? How can you use them?
What is a pragma?
What is the difference between struct and union in C?
Explain high-order bytes.
Write a program to swap two numbers without using the third variable?
What is the difference between typedef struct and struct?
Explain how many levels deep can include files be nested?
Explain 'bit masking'?
What is getch c?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Write a c program to demonstrate character and string constants?
Why is main function so important?