C Programming Quiz


Play this C quiz that will help you to excel in C certification exams, placements etc. This C programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This C programming test enables you to assess your knowledge of C programming.

Take the Free Practice Test



C MCQs

Practice C MCQ Questions, which will help you in understanding programming concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

C Quiz

Try Free C Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

C Quiz

1. What will be the output of the program if the array begins at 1000 and each integer occupies 2 bytes?

void main()
{
    int arr[2][2] = { 1, 2, 3, 4 };
    printf("%u, %u", arr+1, &arr+1);
}

1004 1008
1002 1008
1002 1002
1008 1002

2. What is the output of this program?

void main()
  {
  struct bitfields {
  int bits_1: 2;
  int bits_2: 9;
  int bits_3: 6;
  int bits_4: 1;
  }bit;
  printf("%d", sizeof(bit));
}

2
3
4
0

3. What is the output of this program?

#include <stdio.h>
int main(){
    printf("%d	",sizeof(2.5));
	printf("%d	",sizeof(2));
	printf("%d",sizeof('A'));
	return 0;
}

8 4 2
4 4 1
8 4 1
4 4 2

4. What will be the output of the program ?

#include <stdio.h>
int main()
{
    
	int a[5]={5,1,15,20,25};
    int i,j,m;
    i = ++a[1];
	j = a[1]++; 
    m = a[i++];
	printf("%d, %d, %d", i, j, m);
   
    return 0;
}

3,2,15
2,3,20
2,1,15
1.2.5

5. How many times the loop will execute ?

for(int i = 0 ; i < 10 ; i++)
{
    i  =  i*2;
    i--;
}

10
5
0
Infinite

6. In expression i = g() + f(), first function called depends on __________

Compiler
Associativiy of () operator
Precedence of () and + operator
Left to write of the expression

7. What is the output of this program?

int main()
{
char ch;
ch = 128;
printf("%d", ch);
return 0;
}

128
-128
Depends on compiler
None of the above

8. The EOF character can be included in a file as part of its data

TRUE
May Be
FALSE
Can't Say

9. What will be output for the following code?

#include <stdio.h>
#define TRUE  1
 
int main( ) {
   printf( ""Value of TRUE : %d
"", TRUE);
   return 0;
}

0
1
null
garbage

10. Choose the best one - prior to using a pointer variable

It should be declared.
It should be initialized
It should be both declared and initialized.
None of the above.

Results