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()
{
int a = 5;
void *ptr = &a ;
printf("%f", *(float*)ptr);
return 0;
}

5
5
0
0

2. Which loop is guaranteed to execute at least one time.

for
while
do while
None of the above

3. goto can be used to jump from main to within a function?

TRUE
FALSE
May Be
Can't Say

4. What is the output of this program?

#include <stdio.h>
int main(){
    char c;
    FILE *fp;
    fp=fopen("demo.txt","a+"); // demo.txt : hello you are reading a file
    fprintf(fp," demo");    
	fclose(fp);
    fp=fopen("myfile.txt","r");
    
    while((c=fgetc(fp))!=EOF)
         printf("%c",c);
    fclose(fp);
    return 0;
}

hello you are reading a file
hello you are reading a file demo
demo
None of the above

5. Which of these is not an example for IDE in C?

Turbo
Pycharm
Code::Blocks
Borland

6. Which Committee standardize C Programming Language ?

IEEE
ISO
IEC
ANSI

7. 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

8. Can I increase the size of dynamically allocated array?

Yes
No
May Be
Can't Say

9. How many type of conversion are there in c?

1
2
3
4

10. What is the output of this program?

        
void main()
{
    if(!printf(""))
        printf("hello");
    else
        printf("world");
}

hello
world
Compilation Error
None of the above

Results