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

5/16

Page

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

Which of the following typecasting is accepted by C?

Select an option to see the answer and solution.

Which of the following is a ternary operator?

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 = 2;
    if (a >> 1)
       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 const print()
{
    printf("example.com");
    return 0;
}
void main()
{
    print();
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    double b = 3 && 5 & 4 % 3;
    printf("%lf", b);
}

Select an option to see the answer and solution.

Operation "a = a * b + a" can also be written as . . . . . . . .

Select an option to see the answer and solution.

Which of the following is an invalid assignment operator?

Select an option to see the answer and solution.

Which of the following are unary operators?

Select an option to see the answer and solution.

Which of the following data type will throw an error on modulus operation(%)?

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 = 0, y = 2, z = 3;
    int a = x & y | z;
    printf("%d", 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 y = 2;
    int z = y +(y = 10);
    printf("%d\n", z);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define a 10
int main()
{
    const int a = 5;
    printf("a = %d\n", a);
}

Select an option to see the answer and solution.

What will be the output of the following C function?
#include <stdio.h>
void reverse(int i);
int main()
{
    reverse(1);
}
void reverse(int i)
{
    if (i > 5)
        return ;
    printf("%d ", i);
    return reverse((i++, i));
}

Select an option to see the answer and solution.

For which of the following, "PI++;" code will fail?

Select an option to see the answer and solution.

We want to declare x, y and z as pointers of type int. The alias name given is: intpt The correct way to do this using the keyword typedef is:

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 x = 2, y = 1;
    x *= x + y;
    printf("%d\n", x);
    return 0;
}

Select an option to see the answer and solution.

Relational operators cannot be used on . . . . . . . .

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 k = 4;
    float k = 4;
    printf("%d", k)
}

Select an option to see the answer and solution.

In the following code snippet, character pointer str holds a reference to the string . . . . . . . .
char *str =  "Examveda.com\0" "programming";

Select an option to see the answer and solution.

What is the size of myArray in the code shown below? (Assume that 1 character occupies 1 byte)
typedef char x[10];
x myArray[5];

Select an option to see the answer and solution.