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

10/16

Page

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

What is the difference between the following 2 codes?
#include <stdio.h> //Program 2
int main()
{
    int d, a = 1, b = 2;
    d =  a++ +++b;
    printf("%d %d %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>
int main()
{
   signed char chr;
   chr = 128;
   printf("%d\n", chr);
   return 0;
}

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 = 0, l;
    int z;
    z = y = 1, l = x && y;
    printf("%d\n", l);
    return 0;
}

Select an option to see the answer and solution.

Which of the following statement is false?

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 = 10, b = 10;
    if (a = 5)
    b--;
    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>
int main()
{
    int i = 23;
    char c = -23;
    if (i < c)
        printf("Yes\n");
    else
        printf("No\n");
}

Select an option to see the answer and solution.

Which of the following is true for variable names in C?

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 b = 5 & 4 | 6;
    printf("%d", b);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    const int p;
    p = 4;
    printf("p is %d", p);
    return 0;
}

Select an option to see the answer and solution.

Where in C the order of precedence of operators do not exist?

Select an option to see the answer and solution.

We want to create an alias name for an identifier of the type unsigned long. The alias name is: ul. 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>
void main()
{
    int h = 8;
    int b = 4 * 6 + 3 * 4 < 3 ? 4 : 3;
    printf("%d\n", 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 = 0;
    if (x = 0)
        printf("Its zero\n");
    else
        printf("Its not zero\n");
}

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 = 4;
    int *p = &x;
    int *k = p++;
    int r = p - k;
    printf("%d", r);
}

Select an option to see the answer and solution.

Which data type is most suitable for storing a number 65000 in a 32-bit system?

Select an option to see the answer and solution.

What will be the output of the following C code? (If the name entered is: Shyam)
#include<stdio.h>
#include<string.h>
typedef struct employee
{
    char  name[50];
    int   salary;
} e1;
void main( )
{
    printf("Enter Employee name");
    scanf("%s",e1.name);
    printf("\n%s",e1.name);
}

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 = 4;
    int *p = &x;
    int *k = p++;
    int r = p - k;
    printf("%d", r);
}

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 = 4, c = 1, d;
    d = ++a && ++b || ++c;
    printf("%d, %d, %d, %d\n", a, b, c, d);
    return 0;
}

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 i = 23;
    signed char c = -23;
    if (i > c)
        printf("Yes\n");
    else if (i < c)
        printf("No\n");
}

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;
    x = x << 1;
    printf("%d\n", x);
}

Select an option to see the answer and solution.