CSE MCQs :: C-MCQs
-
What is the output of this C code?
(7 and 8 are entered)
void main()
{
float x;
int y;
printf("enter two numbers \n", x);
scanf("%f %f", &x, &y);
printf("%f, %d", x, y);
} -
What is the output of this C code?
void main()
{
double x = 123828749.66;
int y = x;
printf("%d\n", y);
printf("%lf\n", y);
} -
What is the output of this C code?
void main()
{
int x = 97;
char y = x;
printf("%c\n", y);
} - When double is converted to float, the value is?
-
What is the output of this C code?
int main()
{
unsigned int i = 23;
signed char c = -23;
if (i > c)
printf("Yes\n");
else if (i < c)
printf("No\n");
} -
What is the output of this C code?
int main()
{
int i = 23;
char c = -23;
if (i < c)
printf("Yes\n");
else
printf("No\n");
} - function tolower(c) defined in library works for?
-
What is the output of the below code considering size of short int is 2, char is 1 and int is 4 bytes?
int main()
{
short int i = 20;
char c = 97;
printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
return 0;
} - Which type conversion is NOT accepted?
-
What will be the data type of the result of the following operation?
(float)a * (int)b / (long)c * (double)d