Single Choice Not Set

QWhat will be output when you will execute following c code?

#include<stdio.h>
int main(){
    printf("%d\t",sizeof(6.5));
    printf("%d\t",sizeof(90000));
    printf("%d",sizeof('A'));
    return 0;
}

ID: #901 Data Types in C Language 12,650 views
Question Info
#901Q ID
Not SetDifficulty
Data Types in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 4 4 1
  • B 16 8 4
  • C 8 4 2
  • D 4 2 1
Correct Answer

Explanation

Output on Turbo C++ 3.0:

8 4 2

Output on Turbo C++ 4.5:

8 4 2

Output on Linux GCC:

8 4 4

Output on Visual C++:

8 4 4

By default data type of numeric constants is:

6.5 : double

90000: long int

'A': char

In C size of data type varies from compiler to compiler.

Share This Question

Challenge a friend or share with your study group.