61. What is the type of the following assignment expression if x is of type float and y is of type int?
y = x + y;
y = x + y;
62. What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("Hello World! %d \n", x);
return 0;
}
#include <stdio.h>
int main()
{
printf("Hello World! %d \n", x);
return 0;
}
63. What will be the final value of c in the following C statement? (Initial value: c = 2)
c <<= 1;
c <<= 1;
64. Consider this statement: typedef enum good {a, b, c} hello; Which of the following statements is incorrect about hello?
65. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int ThisIsVariableName = 12;
int ThisIsVariablename = 14;
printf("%d", ThisIsVariablename);
return 0;
}
#include <stdio.h>
int main()
{
int ThisIsVariableName = 12;
int ThisIsVariablename = 14;
printf("%d", ThisIsVariablename);
return 0;
}
66. What will be the output of the following C code?
#include<stdio.h>
int main()
{
typedef union a
{
int i;
char ch[2];
}hello;
hello u;
u.ch[0] = 3;
u.ch[1] = 2;
printf("%d, %d", u.ch[0], u.ch[1]);
return 0;
}
#include<stdio.h>
int main()
{
typedef union a
{
int i;
char ch[2];
}hello;
hello u;
u.ch[0] = 3;
u.ch[1] = 2;
printf("%d, %d", u.ch[0], u.ch[1]);
return 0;
}
67. Which of the following operator has the highest precedence in the following?
68. Which function in the following expression will be called first?
a = func3(6) - func2(4, 5) / func1(1, 2, 3);
a = func3(6) - func2(4, 5) / func1(1, 2, 3);
69. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 1;
short int i = 2;
float f = 3;
if (sizeof((x == 2) ? f : i) == sizeof(float))
printf("float\n");
else if (sizeof((x == 2) ? f : i) == sizeof(short int))
printf("short int\n");
}
#include <stdio.h>
int main()
{
int x = 1;
short int i = 2;
float f = 3;
if (sizeof((x == 2) ? f : i) == sizeof(float))
printf("float\n");
else if (sizeof((x == 2) ? f : i) == sizeof(short int))
printf("short int\n");
}
70. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int h = 8;
int b = h++ + h++ + h++;
printf("%d\n", h);
}
#include <stdio.h>
void main()
{
int h = 8;
int b = h++ + h++ + h++;
printf("%d\n", h);
}
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.