Data Types
- Which of the following is the correct output for the program given below?
#include <stdio.h>
int main ( )
{
printf ("%d %d %d\n" , sizeof(2.19f), sizeof(2.19), sizeof (2.19l));
return 0 ;
}
-
View Hint View Answer Discuss in Forum
sizeof(2.19f) here '2.19f' specifies the float data type. Hence size of float is 4 bytes.
sizeof(2.19) here '2.19' specifies the double data type. Hence size of float is 8 bytes.
sizeof(2.19l) here '2.19l' specifies the long double data type. Hence size of float is 10 bytes.Correct Option: B
sizeof(2.19f) here '2.19f' specifies the float data type. Hence size of float is 4 bytes.
sizeof(2.19) here '2.19' specifies the double data type. Hence size of float is 8 bytes.
sizeof(2.19l) here '2.19l' specifies the long double data type. Hence size of float is 10 bytes.
- Which of the following is the correct output for the program given below?
#include <stdio.h>
int main ( )
{
float n = 5.375 ;
printf("%f %e %E\n" , n, n, n) ;
return 0 ;
}
-
View Hint View Answer Discuss in Forum
5.375000 5.375000e+000 5.375000E+000
Correct Option: C
5.375000 5.375000e+000 5.375000E+000
- What is the output of this C code?
#include <stdio.h>
int main()
{
char chr;
chr = 128;
printf("%d\n", chr);
return 0;
}
-
View Hint View Answer Discuss in Forum
Signed char will be a negative number.
Correct Option: B
Signed char will be a negative number.
- %lf is used to display?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
double
- Predict the data type of the following mathematical operation?
2 * 9 + 3 / 2 . 0
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
double