Vidyalelo
C Programming · all questions

C Miscellaneous
practice.

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

70

Questions

1/4

Page

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

Determine output:
void main()
{
      int const *p=5;
      printf("%d", ++(*p));
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      char s[]="man";
      int i;
      for(i=0; s[i]; i++)
            printf("%c%c%c%c ", s[i], *(s+i), *(i+s), i[s]);
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      float me = 1.1;
      double you = 1.1;
      if(me==you)
            printf("I hate Examveda");
      else
            printf("I love Examveda");
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      static int var = 5;
      printf("%d ", var--);
      if(var)
            main();
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      char *p;
      printf("%d %d", sizeof(*p), sizeof(p));
}

Select an option to see the answer and solution.

Determine the Final Output:
void main()
{
      printf("\nab");
      printf("\bsi");
      printf("\rha");
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      int i=10;
      i=!i>14;
      printf("i=%d", i);
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      int c = - -2;
      printf("c=%d", c);
}

Select an option to see the answer and solution.

Determine Output:
#define int char
void main()
{
      int i = 65;
      printf("sizeof(i)=%d", sizeof(i));
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      int i=3;
      switch(i)
      {
            default: printf("zero");
            case 1: printf("one"); break;
            case 2: printf("two"); break;
            case 3: printf("three"); break;
      }
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      char string[]="Hello World";
      display(string);
}
void display(char *string)
{
      printf("%s", string);
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      int i=5;
      printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}

Select an option to see the answer and solution.

Determine Output:
#define square(x) x*x
void main()
{
      int i;
      i = 64/square(4);
      printf("%d", i);
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      char *p="hi friends", *p1;
      p1=p;
      while(*p!='\0') ++*p++;
      printf("%s", p1);
}

Select an option to see the answer and solution.

Determine Output:
#include<stdio.h>
#define a 10
void main()
{
      #define a 50
      printf("%d", a);
}

Select an option to see the answer and solution.

Determine Output:
#define clrscr() 100
void main()
{
      clrscr();
      printf("%d", clrscr());
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      printf("%p", main);
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      char far *farther, *farthest;
      printf("%d..%d", sizeof(farther), sizeof(farthest));
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      char *p;
      p="Hello";
      printf("%c", *&*p);
}

Select an option to see the answer and solution.

Determine Output:
void main()
{
      int i=1;
      while(i<=5)
      {
            printf("%d", i);
            if(i>2)
                  goto here;
            i++;
      }
}
fun()
{
      here:  printf("PP");
}

Select an option to see the answer and solution.