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
How does struct work in c?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What is restrict keyword in c?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
What are the types of pointers in c?
Why main is used in c?
What is the function of this pointer?
what is the significance of static storage class specifier?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What are c preprocessors?
What is exit() function?
What is the difference between char array and char pointer?
What are the data types present in c?
Describe the steps to insert data into a singly linked list.