Data Types, Variables and Storage Classes
Data types Variables and Storage Classes
Questions
What will be the output of the following set of codes after execution?
void main()
{
printf(“%d %d %d ”,56,056,0x56);
}
- 56 56 56
- 56 056 56
- 56 46 86
- 56 56 86
What will be the output of the following set of code after execution?
void main()
{
printf(“%c %d”,'C','C');
}
- C C
- 67 67
- C Garbage Value
- C 67
What will be the output of the following set of codes after execution?
void main()
{
int m=32769;
unsigned int n=65540;
printf(“%d %u”,m,n);
}
- Garbage value
- - 32767 4
- - 32768 0
- - 32767 3
What will be the output of the following set of code after execution?
void main()
{
float m=3.6e38;
printf(“%f”,m);
}
- +INF
- - INF
- 0.000000
- Garbage value
Which one does not act as an identifier?
- Macro name
- User defined Function Name
- Keywords
- Variable name
What will be the output of the following set of code after execution?
void main()
{
printf(“ABC +CDE”);
}
- ABC +CDE
- ABC + CDE
- ABC CDE
- ABC +DE
Which of the following does not belong to basic data type?
- int
- float
- char
- short
Which one is wrong with respect to variable name in C language?
- Variable name should start with alphabet.
- Variable name contains the space.
- Variable name should be different from the keywords.
- Variable name contains underscore(_).
Which format specifier is used for printing an unsigned integer in hexadecimal number system?
- %h
- %u
- %x
- %hd
If C language uses two bytes of memory for storing the integer data type, what is the maximum value that an integer data type accommodates?
- 216
- 215-1
- 215
- 215+1
If there is a string constant “abcdefdgi”, how many bytes are required to store it in memory?
- 10
- 9
- 1
- 2
What will be the output of the following set of code after execution?
void main()
{
printf(“%d %d”,sizeof('9'),sizeof(567));
}
- 1 3
- 1 2
- 2 2
- 2 3
Characteristics of variable in C language are:
- value and types of variable
- name and location in the memory
- its value can change during execution.
- all of these
Which storage class declared the identifiers in the global scope?
- Auto
- Static
- Register
- Extern
Which of the following is the default storage class in C language?
- Auto
- Static
- Register
- Extern
In C language, which is/are the derived data type(s)?
- Structure
- Function
- Array
- All of the above
What will be the output of the following set of codes after execution?
void main()
{
printf(“%d”,sizeof(' '));
}
- 2
- 1
- 0
- Garbage value