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 i;
    i = printf("letsfindcourse");
    i = printf("%d ", i);
    printf("%d ", i);
    return 0;
}

letsfindcourse 15 3
letsfindcourse 14 2
letsfindcourse 14 3
Compilation Error

2. What will be output for the following code?

#include <stdio.h>
int main()
{
    int a = 1, b = 2;
    int c = a ^ b & 1;
    printf(""%d
"", c);
}

0
1
2
3

3. What is the Error of this program?

#include <stdio.h>
#include  <stdlib.h>
int main()

{
     char *ptr;
     *ptr = (char)malloc(30);
     strcpy(ptr, "RAM");
     printf("%s", ptr);
     free(ptr);
     return 0;
}

Error: in strcpy() statement.
Error: in *ptr = (char)malloc(30);
Error: in free(ptr);
No error

4. Select a function which is used to write a string to a file?

pits()
putc()
fputs()
fgets()

5. malloc() returns a NULL if it fails to allocate the requested memory.

TRUE
FALSE
May Be
Can't Say

6. Which operator connects the structure name to its member name?

-
->
.
both . and ->

7. Which of the following statement is correct prototype of the malloc() function in c ?

int* malloc(int);
Char* malloc(char);
unsigned int* malloc(unsigned int);
void* malloc(size_t);

8. Enumeration (or enum) is a ______ data type in C?

user defined
built-in
libary
None Of the above

9. Identify the correct statement?

The variable names VOLUME and volume are identical
The variable names sun and sun are identical
Variables are not declared before use
Variable may he absent in a declaration.

10. Which of the following are themselves a collection of different data types?

String
Structures
Char
None of the above

Results