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. C compiler traps

logical errors
syntax errors
Both A and B
none of the above

2. Comment on this const int *ptr;

You cannot change the value pointed by ptr
You cannot change the pointer ptr itself
Both (a) and (b)
You can change the pointer as well as the value pointed by it

3. What is the output of the following code?

int main()
{
    int i = 0;
    switch(i)
    {
    case 0 : i++;
    case 1 : i+++2;
    case 2 : ++i;
    }
    pritnf("%d",i++);

    return 0;
}

2
3
4
5

4. How would you round off a value from 6.66 to 7.0?

ceil(6.66)
floor(6.66)
roundup(6.66)
roundto(6.66)

5. argc refers to the?

number of arguments passed
a pointer array
Both A and B
None of the above

6. The NULL character indicates an end of a string and a file.

TRUE
May Be
FALSE
Can't Say

7. What is the output of this program?

		   
#include <stdio.h>
int demo()
{
  static int i = 0;  
  printf("%d ",i++);
}
int main()
{
  for(int j = 0 ; j < 5 ; j++ )
  {
      demo();
  }
}

0 0 0 0 0
1 1 1 1 1
1 2 3 4 5
0 1 2 3 4

8. Which of the following statements is not true?

FORTRAN is a high-level language
A FORTRAN program written for the IBM-PC, is totally different from a FORTRAN program written for the execution of SUN machine.
FORTRAN is extensively used write program for performing scientific computations
None of the above

9. What is the output of this program?

#include <stdio.h>
int main(){
   struct simp 
	{
		int i = 6;
		char city[] = "chennai";
	};
	struct simp s1;
	printf("%d",s1.city);
	printf("%d", s1.i);
    return 0;
}

chennai 6
Nothing will be displayed
Runtime Error
Compilation Error

10. What is correct about the given program?

#include <stdio.h>
int x;
void main()
{
    if (x);
    else
        printf("Else");
}

if block will be executed
else block will be executed
Depends on value of x since it is undeclared
Compilation Error

Results