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
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
double n = 23458965.12124;
int m = n;
printf("%d", m);
printf(" %lf", m);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
23458965, 0.000000
- What will be the output of the following C code? (Initial values: p= 10, q = 12)
#include <stdio.h>
void main()
{
float p;
int q;
printf("Enter two numbers: ", p);
scanf("%f %f", &p, &q);
printf("%f, %d", p, q);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
10.000000, Garbage value
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
float num = 0.2;
printf("%d, ", num);
printf("%f", num);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Garbage value, 0.200000
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int n = 98;
char m = n;
printf("%c\n", m);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
b