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

If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1578


how many key words availabel in c a) 28 b) 31 c) 32

627


What will be the outcome of the following conditional statement if the value of variable s is 10?

753


How to implement a packet in C

2383


Tell us bitwise shift operators?

588






Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5784


Write the Program to reverse a string using pointers.

609


What is a scope resolution operator in c?

738


Explain how to reverse singly link list.

597


Why is it usually a bad idea to use gets()? Suggest a workaround.

888


can we have joblib in a proc ?

1647


What is the use of gets and puts?

590


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

704


What does static variable mean in c?

641


What is meant by realloc()?

663