Data Types
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
float num = 0.3;
if (num == 0.3)
printf("Interview Mania");
else
printf("Advanced C Classes");
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Advanced C Classes
- Which of the data types has the size that is variable?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Since the size of the structure depends on its fields, it has a variable size.
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
float f = 'I';
printf("%f", f);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Since the ASCII value of I is 73, the same is assigned to the float variable and printed.
- What is the size of an int data type?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The size of the data types depend on the system.
- Which of the following is a User-defined data type?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
typedef and struct are used to define user-defined data types.