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. HUGE_VAL macro is used when the output of the function may not be ___________

integer number
short int
long int
floating point numbers

2. What is the output of this program?

main ( )
{
     float a=4.1589;
    printf("%2.1f", a);
    return 0;
}

4
4.1
4.2
4

3. What is the output of this program?

#include <stdio.h>
int main()
{
    char str = "Hello";
    printf("%s", str);
    return 0;
}

Hello
Base address of str
Segmentation Fault
None of the above

4. What is the output of this program?

#include <stdio.h>
int main()
{
    int x = 1, y = 2;
    printf("%*d", x, y);
    return 0;
}

1
2
Compilation Error
Garbage Value

5. What is the output of this program?

main ( )
{
 int i=5;
 printf( "%d %d %d " , i,i<<2,i<<2);
}

5 20 1
5 1 20
5 20 20
5 1 1

6. What will be the output of the program in 16 bit platform ?

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

2
4
8
Linker Error

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

8. What is the output of this program?

#include <stdio.h>
#include  <stdlib.h>
int main()
{
  int i;
  char *ptr;
  char *fun();
  ptr = fun();
  printf(" %s", ptr);
  return 0;
}

char *fun()
{
  char disk[30];
  strcpy(disk, "letsfindcourse");
  printf("%s ",disk);
  return disk;
}

letsfindcourse
Compilation error
letsfindcourse letsfindcourse
garbage value

9. A string that is a formal parameter can be declared

An array with empty braces
A pointer to character
Both A and B
None of the above

10. typedef int (*PFI)(char *, char *)creates ___________

type PFI, for pointer to function (of two char * arguments) returning int
error
type PFI, function (of two char * arguments) returning int
type PFI, for pointer

Results