Variables & Datatypes in C
21. What is the output of this program?
int main()
{
char ch;
ch = 128;
printf("%d\n", ch);
return 0;
}
View Answer
22. What is the output of this program?
int main()
{
float x = 'a';
printf("%f", x);
return 0;
}
View Answer
23. How would you round off a value from 6.66 to 7.0?
View Answer
24. What will be the output of the program in 16 bit platform ?
#include<stdio.h>
int main()
{
extern int i;
i = 20;
printf("%d\n", sizeof(i));
return 0;
}
View Answer
25. What will be output when you will execute following c code?
#include<stdio.h>
int main()
{
printf("%d\t",sizeof(5.5));
printf("%d\t",sizeof(50000));
printf("%d",sizeof('A'));
return 0;
}
View Answer
26. What is the output of this program?
void main()
{
int i=0, j=1, k=2, m;
m = i++ || j++ || k++;
printf("%d %d %d %d", m, i, j, k);
}
View Answer
27. What is the output of this program?
void main()
{
int c = - -14;
printf("%d", c);
}
View Answer
28. What is the output of this program?
void main()
{
int i=5;
i = !i>10;
printf("%d", i);
}
View Answer
Also check :