What is variable in c with example?



What is variable in c with example?..

Answer / utsav patel

in c language five types of variable are present
1) local variable.
2) global variable.
3) static variable.
4) automatic variable.
5) external variable.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Write a C program to perform some of the operation which can be performed using Single linked list

1 Answers   Qualcomm,


What is a static function in c?

0 Answers  


You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.

2 Answers   Qualcomm,


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

0 Answers  


Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors

3 Answers  






What do you mean by invalid pointer arithmetic?

0 Answers  


const char * char * const What is the differnce between the above tow?.

6 Answers   Ramco, TCS,


Is the following code legal? struct a { int x; struct a b; }

4 Answers  


Write a c program using for loop in switch case?

1 Answers   Infosys,


What is the difference between big endian form and little endian form? write a code to convert big endian form to little endian and vice versa..

5 Answers   Aricent, TCS,


Why is c used in embedded systems?

0 Answers  


Why c is known as a mother language?

0 Answers  


Categories