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 is the output of this program?

#include <stdio.h>
int main(){
   signed a;
	unsigned b;
	a = 6u + -16 + 16u + -6;
	b = a + 1;
	if(a == b)
	printf("%d %d",a,b);
	else
	printf("%u %u",a, b);
    return 0;
}

Compilation error
1 0
0 0
0 1

2. Output of this statment is :

 
printf ( "%d" , printf ( "hello" ) );

Syntex Error
hello5
gives garbage value
print hello and terminates

3. What is the output of this program?

#include <stdio.h>
# define scanf  "%s Find best course "
main()
{
   printf(scanf, scanf);
   return 0;
}

%s Find best course Find best course
%s Find best course %s Find best course
Invalid Syntex
Run time error

4. A file written in text mode can be read back in binary mode.

Yes
No
May Be
Can't Say

5. What is the output of this program?

#include <stdio.h>
void main()
{
    int a = 3;
    while (a--)
    {
        int a = 10;
        a--;
        printf("%d ", a);
    }
}

9 9 9
9 8 7
2 1 0
Infinite loop

6. Which statment is true about the given code ?

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

Goes in infinite loop
Gives Address of function main.
Gives garbage value
Compilation Error

7. Which is false?

Constant variables need not be defined as they are declared and can be defined later
Global constant variables are initialized to zero
const keyword is used to define constant values
You cannot reassign a value to a constant variable

8. What is the output of this program?

char *str = "char *str = %c%s%c; main(){ printf(str, 4, str, 4);}";
int main()
{
    printf(str, 4, str, 4);
    return 0;
}

char *str = "char *str = %c%s%c; main(){ printf(str, 4, str, 4);}"; main(){ printf(str, 4, str, 4);}
char *str = %c%s%c; main(){ printf(str, 4, str, 4);}
No output
Error in program

9. What is the output of this program?

#include <stdio.h>
void main()
{
int arr[3] = {1, 2, 3};
int *ptr = arr;
int **temp = &ptr ; 
printf("%p %p", *temp, arr);
}

Same Address
Different Address
1 2
2 3

10. What is the output of the following code?

int main()
{
    int k=1;
    printf("%d == 1 is" "%s", k, k==1?"TRUE":"FALSE");
    return 0;
}\

k == 1 is TRUE
1 == 1 is TRUE
1 == 1 is FALSE
K == 1 is FALSE

Results