C Programming MCQs with answers Page - 12

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 final value of x in the following C code?

Code:
#include <stdio.h>
    void main()
    {
        int x = 5 * 9 / 3 + 9;
    }
  • (A) 3.75
  • (B) Depends on compiler
  • (C) 24
  • (D) 3

A

Admin • 833K Points
Coach

Q. What will be the output of the following C code? (Initial values: x= 7, y = 8)

Code:
#include <stdio.h>
    void main()
    {
        float x;
        int y;
        printf("enter two numbers 
", x);
        scanf("%f %f", &x, &y);
        printf("%f, %d", x, y);
    }
  • (A) 7.000000, 7
  • (B) Run time error
  • (C) 7.000000, junk
  • (D) Varies

A

Admin • 833K Points
Coach

Q. C99 standard guarantees uniqueness of __________ characters for internal names.

  • (A) 31
  • (B) 63
  • (C) 12
  • (D) 14

A

Admin • 833K Points
Coach

Q. C99 standard guarantees uniqueness of ___________ characters for external names.

  • (A) 31
  • (B) 6
  • (C) 12
  • (D) 14

A

Admin • 833K Points
Coach

Q. Which of the following is not a valid variable name declaration?

  • (A) int __a3;
  • (B) int __3a;
  • (C) int __A3;
  • (D) None of the mentioned

A

Admin • 833K Points
Coach

Q. Why do variable names beginning with the underscore is not encouraged?

  • (A) It is not standardized
  • (B) To avoid conflicts since assemblers and loaders use such names
  • (C) To avoid conflicts since library routines use such names
  • (D) To avoid conflicts with environment variables of an operating system

A

Admin • 833K Points
Coach

Q. Variable name resolution (number of significant characters for the uniqueness of variable) depends on

  • (A) Compiler and linker implementations
  • (B) Assemblers and loaders implementations
  • (C) C language
  • (D) None of the mentioned

A

Admin • 833K Points
Coach

Q. What will be the output of the following C co #include

Code:
<stdio.h>
        int main()
        {
            printf("Hello World! %d 
", x);
            return 0;
        }
  • (A) Hello World! x;
  • (B) Hello World! followed by a junk value
  • (C) Compile time error
  • (D) Hello World!

A

Admin • 833K Points
Coach

Q. The format identifier ‘%i’ is also used for _____ data type.

  • (A) char
  • (B) int
  • (C) float
  • (D) double

A

Admin • 833K Points
Coach

Q. Which data type is most suitable for storing a number 65000 in a 32-bit system?

  • (A) signed short
  • (B) unsigned short
  • (C) long
  • (D) int

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