Data Types, Variables and Storage Classes

Data types Variables and Storage Classes

17 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What will be the output of the following set of codes after execution?
void main()
{
printf(“%d %d %d ”,56,056,0x56);
}

  1. 56 56 56
  2. 56 056 56
  3. 56 46 86
  4. 56 56 86
Question 2 Multiple Choice (Single Answer)

What will be the output of the following set of code after execution?

void main()
{
printf(“%c %d”,'C','C');
}

  1. C C
  2. 67 67
  3. C Garbage Value
  4. C 67
Question 3 Multiple Choice (Single Answer)

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);
}

  1. Garbage value
  2. - 32767 4
  3. - 32768 0
  4. - 32767 3
Question 4 Multiple Choice (Single Answer)

What will be the output of the following set of code after execution?

void main()
{
float m=3.6e38;
printf(“%f”,m);
}

  1. +INF
  2. - INF
  3. 0.000000
  4. Garbage value
Question 5 Multiple Choice (Single Answer)

Which one does not act as an identifier?

  1. Macro name
  2. User defined Function Name
  3. Keywords
  4. Variable name
Question 6 Multiple Choice (Single Answer)

What will be the output of the following set of code after execution?

void main()
{
printf(“ABC +CDE”);
}

  1. ABC +CDE
  2. ABC + CDE
  3. ABC CDE
  4. ABC +DE
Question 7 Multiple Choice (Single Answer)

Which of the following does not belong to basic data type?

  1. int
  2. float
  3. char
  4. short
Question 8 Multiple Choice (Single Answer)

Which one is wrong with respect to variable name in C language?

  1. Variable name should start with alphabet.
  2. Variable name contains the space.
  3. Variable name should be different from the keywords.
  4. Variable name contains underscore(_).
Question 9 Multiple Choice (Single Answer)

Which format specifier is used for printing an unsigned integer in hexadecimal number system?

  1. %h
  2. %u
  3. %x
  4. %hd
Question 10 Multiple Choice (Single Answer)

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?

  1. 216
  2. 215-1
  3. 215
  4. 215+1
Question 11 Multiple Choice (Single Answer)

If there is a string constant “abcdefdgi”, how many bytes are required to store it in memory?

  1. 10
  2. 9
  3. 1
  4. 2
Question 12 Multiple Choice (Single Answer)

What will be the output of the following set of code after execution?

void main()
{
printf(“%d %d”,sizeof('9'),sizeof(567));
}

  1. 1 3
  2. 1 2
  3. 2 2
  4. 2 3
Question 13 Multiple Choice (Single Answer)

Characteristics of variable in C language are:

  1. value and types of variable
  2. name and location in the memory
  3. its value can change during execution.
  4. all of these
Question 14 Multiple Choice (Single Answer)

Which storage class declared the identifiers in the global scope?

  1. Auto
  2. Static
  3. Register
  4. Extern
Question 15 Multiple Choice (Single Answer)

Which of the following is the default storage class in C language?

  1. Auto
  2. Static
  3. Register
  4. Extern
Question 16 Multiple Choice (Single Answer)

In C language, which is/are the derived data type(s)?

  1. Structure
  2. Function
  3. Array
  4. All of the above
Question 17 Multiple Choice (Single Answer)

What will be the output of the following set of codes after execution?

void main()
{
printf(“%d”,sizeof(' '));
}

  1. 2
  2. 1
  3. 0
  4. Garbage value