Vidyalelo
C Programming · all questions

C Fundamentals
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

303

Questions

3/16

Page

Pick an option on a question to see the right answer and solution.

If integer needs two bytes of storage, then maximum value of an unsigned integer is

Select an option to see the answer and solution.

What is the correct value to return to the operating system upon the successful completion of a program?

Select an option to see the answer and solution.

Which is the only function all C programs must contain?

Select an option to see the answer and solution.

Which of the following is not a correct variable type?

Select an option to see the answer and solution.

What number would be shown on the screen after the following statements of C are executed?
char ch; 
int i; 
ch = 'G'; 
i = ch-'A';
printf("%d", i);

Select an option to see the answer and solution.

Which of following is not a valid name for a C variable?

Select an option to see the answer and solution.

Find the output of the following program. void main() { int i=01289; printf("%d", i); }

Select an option to see the answer and solution.

Find the output of the following program.
void main()
{
   int i=065, j=65;
   printf("%d %d", i, j);
}

Select an option to see the answer and solution.

If ASCII value of 'x' is 120, then what is the value of the H, if
H = ('x' – 'w' ) / 3;

Select an option to see the answer and solution.

What is the difference between a declaration and a definition of a variable?

Select an option to see the answer and solution.

"My salary was increased by 15%" Select the statement, which will EXACTLY reproduce the line of text above.

Select an option to see the answer and solution.

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?

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

Will the following C code compile without any error?
#include <stdio.h>
int main()
{
    for (int k = 0; k < 10; k++);
        return 0;
}

Select an option to see the answer and solution.

Variable name resolution (number of significant characters for the uniqueness of variable) depends on . . . . . . . .

Select an option to see the answer and solution.

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;

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

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++);
}

Select an option to see the answer and solution.