C Programming MCQs with answers Page - 10

Here, you will find a collection of MCQ questions on C Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833K Points
Coach

Q. What will be the output of the following C code?

Code:
#include <stdio.h>
    void main()
    {
        double n = 23458965.12124;
        int m = n;
        printf("%d", m);
        printf("  %lf", m);
    }
  • (A) 23458965, 0.000000
  • (B) Compilation Error
  • (C) Runtime Error
  • (D) None of the mentioned

A

Admin • 833K Points
Coach

Q. What will be the output of the following C code? (Initial values: p= 10, q = 12)

Code:
#include <stdio.h>
    void main()
    {
        float p;
        int q;
        printf("Enter two numbers: ", p);
        scanf("%f %f", &p, &q);
        printf("%f, %d", p, q);
    }
  • (A) 10.000000, 12
  • (B) 12, 10.000000
  • (C) 12, Garbage value
  • (D) 10.000000, Garbage value

A

Admin • 833K Points
Coach

Q. How is search done in #include and #include “somelibrary.h” according to C standard?

  • (A) When former is used, current directory is searched and when latter is used, standard directory is searched
  • (B) When former is used, standard directory is searched and when latter is used, current directory is searched
  • (C) When former is used, search is done in implementation defined manner and when latter is used, current directory is searched
  • (D) For both, search for ‘somelibrary’ is done in implementation-defined places

A

Admin • 833K Points
Coach

Q. How many number of pointer (*) does C have against a pointer variable declaration?

  • (A) 7
  • (B) 127
  • (C) 255
  • (D) No limits

A

Admin • 833K Points
Coach

Q. Which of the following is not possible statically in C language?

  • (A) Jagged Array
  • (B) Rectangular Array
  • (C) Cuboidal Array
  • (D) Multidimensional Array

A

Admin • 833K Points
Coach

Q. Which of the following return-type cannot be used for a function in C?

  • (A) char *
  • (B) struct
  • (C) void
  • (D) none of the mentioned

A

Admin • 833K Points
Coach

Q. The standard header _______ is used for variable list arguments (…) in C.

  • (A) <stdio.h >
  • (B) <stdlib.h>
  • (C) <math.h>
  • (D) <stdarg.h>

A

Admin • 833K Points
Coach

Q. When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?

  • (A) Standard input
  • (B) Standard output
  • (C) Standard error
  • (D) All of the mentioned

A

Admin • 833K Points
Coach

Q. In C language, FILE is of which data type?

  • (A) int
  • (B) char *
  • (C) struct
  • (D) None of the mentioned

A

Admin • 833K Points
Coach

Q. What is the sizeof(char) in a 32-bit C compiler?

  • (A) 1 bit
  • (B) 2 bits
  • (C) 1 Byte
  • (D) 2 Bytes

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ