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


Please Help Members By Posting Answers For Below Questions

Is struct oop?

576


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1576


What is page thrashing?

649


What are local static variables? How can you use them?

642


What is a pragma?

666






What is the difference between struct and union in C?

568


Explain high-order bytes.

670


Write a program to swap two numbers without using the third variable?

591


What is the difference between typedef struct and struct?

594


Explain how many levels deep can include files be nested?

623


Explain 'bit masking'?

648


What is getch c?

847


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 ?

802


Write a c program to demonstrate character and string constants?

1678


Why is main function so important?

611