51. Which of the following is the correct order of evaluation for the given expression?
a = w % x / y * z;
a = w % x / y * z;
52. What will be the output of the following C code?
#include <stdio.h>
int main()
{
char c;
int i = 0;
FILE *file;
file = fopen("test.txt", "w+");
fprintf(file, "%c", 'a');
fprintf(file, "%c", -1);
fprintf(file, "%c", 'b');
fclose(file);
file = fopen("test.txt", "r");
while ((c = fgetc(file)) != -1)
printf("%c", c);
return 0;
}
#include <stdio.h>
int main()
{
char c;
int i = 0;
FILE *file;
file = fopen("test.txt", "w+");
fprintf(file, "%c", 'a');
fprintf(file, "%c", -1);
fprintf(file, "%c", 'b');
fclose(file);
file = fopen("test.txt", "r");
while ((c = fgetc(file)) != -1)
printf("%c", c);
return 0;
}
53. What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("Ram\rShyam\n");
return 0;
}
#include <stdio.h>
int main()
{
printf("Ram\rShyam\n");
return 0;
}
54. What will be the output of the following C code?
#include <stdio.h>
void main()
{
double b = 3 % 0 * 1 - 4 / 2;
printf("%lf", b);
}
#include <stdio.h>
void main()
{
double b = 3 % 0 * 1 - 4 / 2;
printf("%lf", b);
}
55. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 1, y = 0, z = 5;
int a = x && y && z++;
printf("%d", z);
}
#include <stdio.h>
void main()
{
int x = 1, y = 0, z = 5;
int a = x && y && z++;
printf("%d", z);
}
56. What will be the value of the following C expression?
(x = foo()) != 1 considering foo() returns 2
(x = foo()) != 1 considering foo() returns 2
57. In expression i = g() + f(), first function called depends on . . . . . . . .
58. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int h = 8;
int b = (h++, h++);
printf("%d%d\n", b, h);
}
#include <stdio.h>
void main()
{
int h = 8;
int b = (h++, h++);
printf("%d%d\n", b, h);
}
59. When double is converted to float, then the value is?
60. Which of the following keywords is used to define an alternate name for an already existing data type?
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.