51. "My salary was increased by 15%"
Select the statement, which will EXACTLY reproduce the line of text above.
52. short testarray[4][3] = { {1}, {2,3}, {4,5,6}};
printf("%d", sizeof(testarray));
Assuming a short is two bytes long, what will be printed by the above code?
short testarray[4][3] = { {1}, {2,3}, {4,5,6}};
printf("%d", sizeof(testarray));
Assuming a short is two bytes long, what will be printed by the above code?
53. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 97;
char y = x;
printf("%c\n", y);
}
#include <stdio.h>
void main()
{
int x = 97;
char y = x;
printf("%c\n", y);
}
54. Will the following C code compile without any error?
#include <stdio.h>
int main()
{
for (int k = 0; k < 10; k++);
return 0;
}
#include <stdio.h>
int main()
{
for (int k = 0; k < 10; k++);
return 0;
}
55. Variable name resolution (number of significant characters for the uniqueness of variable) depends on . . . . . . . .
56. What will be the final values of a and c in the following C statement? (Initial values: a = 2, c = 1)
c = (c) ? a = 0 : 2;
c = (c) ? a = 0 : 2;
57. What will be the output of the following C code?
#include <stdio.h>
int main()
{
unsigned int a = 10;
a = ~a;
printf("%d\n", a);
}
#include <stdio.h>
int main()
{
unsigned int a = 10;
a = ~a;
printf("%d\n", a);
}
58. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 1, b = 2;
a += b -= a;
printf("%d %d", a, b);
}
#include <stdio.h>
int main()
{
int a = 1, b = 2;
a += b -= a;
printf("%d %d", a, b);
}
59. 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);
}
60. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 1, b = 1, d = 1;
printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++);
}
#include <stdio.h>
int main()
{
int a = 1, b = 1, d = 1;
printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++);
}
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.