Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

5000+ C Programming Language MCQs with Answers

5000+ C Programming Language MCQs with Answers

C Programming Language is a general-purpose computer programming language that was created in 1970s. C programming lanaguage was a successor to the B programming language. It was originally developed at Bell Labs by Dennis Ritchie between 1972 and 1973 to construct utilities running on Unix. In this post MCQs.net provides C Programming Language MCQs with brief explanatory Answers.

C Programming Language was created in

C Programming Language first appeared in:

  1. 1952
  2. 1963
  3. 1972
  4. 1982

Correct answer: 3. 1972

Who created C Programming Language

C Programming language was created by:

  1. James Gosling
  2. Bill Joy
  3. Dennis Ritchie
  4. Patrick Naughton

Correct answer: 3. Dennis Ritchie

Number of keywords in C language are

Number of keywords in C language are

  1. 8
  2. 16
  3. 32
  4. 64

Correct answer: 3. 32

Explanation: C language has 32 total keywords. The list of these keywords is:

autodoubleintstruct
breakelselongswitch
caseenumregistertypedef
charexternreturnunion
continueforsignedvoid
doifstaticwhile
defaultgotosizeofvolatile
constfloatshortunsigned

When a block of statements has to be executed among many blocks which of the C language keywords is used

When a block of statements has to be executed among many blocks which of the C language keywords is used:

  1. Output
  2. Break
  3. Switch, Case and Default
  4. Char

Correct answer: 3. Switch, case and default

All keywords in C programming language are in which case

All keAll keywords in C programming language are in which case

  1. LowerCase letters
  2. UpperCase letters
  3. CamelCase letters
  4. None of these

Correct answer: 1. LowerCase letters

volatile cannot be a variable name in C

volatile cannot be a variable name in C:

  1. True
  2. False

Correct answer: 1. True

Explanation: volatile cannot be a variable name in C, since volatile is the name of keyword. In C language a keyword name can not be used as a variable name.

In C language input/output are taken using

In C language input/output are taken using:

  1. printf()/scanf()
  2. scanf()/printf()
  3. in()/out()
  4. get()/throw()

Correct answer: 2. scanf()/printf()

Explanation: In C programming the scanf() function is used to take input from the user, while printf() function is used to display output to the user

Role of #include <stdio.h> in C programming language

See following line of codes:

#include <stdio.h>       //header section

int main()             //main section

{

    printf(“mcqs net”);

    return 0;

}

The #include <stdio.h> in above code is

  1. File inclusion directive
  2. Preprocessor directive
  3. Inclusion directive
  4. None of these

Correct answer: 2. Preprocessor directive

Explanation: Preprocessor directives are generally used to make source programs easier to compile in different execution environments. Directives in the source file tell the preprocessor to take specific actions.

stdio.h is actually a header file that has the necessary information for including input/output related functions in our program.

While #include is a preprocessor directory that will include file that is given within the angle brackets “<>” into the current source file.

Whenever you are using #include<stdio.h> in your c program, it includes stdio.h file into your source program that has info for all input, output-related functions.

The short int in C programming imply

  1. The basic data types
  2. Qualifiers
  3. Short is the qualifier and int is basic data type
  4. Short is the data type and int is qualifier

Correct answer: 3. Short is the qualifier and int is basic data type

Explanation:

Basic data types in C programming language

  1. Integer: Used for storing various whole numbers, such as 3, 5, 212, etc.
  2. Character: Corresponds to all ASCII character sets as well as the single alphabets, e.g ‘X’, ‘y’, ‘z’
  3. Double: A double is the data type in C language that is used to store high-precision floating-point data or numbers
  4. Floating-point: It refers to all the real number values or decimal points. Examples are 33.2, 510.225 etc

Qualifiers in C programming language

Qualifiers in C are defined as the keywords that are applied to the data types or type modifiers in C. A qualifier is applied to basic data types in order to alter or modify its sign or size. There are three types of qualifiers which are:

  1. Size Qualifiers (short, long)
  2. Sign Qualifiers (signed, unsigned)
  3. Type qualifiers

The result of logical or relational expression in C Language is

The result of logical or relational expression in C Language is:

  1. True or False
  2. 0 or 1
  3. T or F
  4. Yes or No

Correct answer: 2. 0 or 1

Explanation:

Relational operators & logical operators in the C programming language are used to compare two values. If the relation is true, 1 is returned. However, if the relation is false, 0 is returned.

Relational operators in C language:

OperatorsWhat they mean
==Equal to
Greater than
Less than
!=Not equal to
>=Greater than or equal to
<=Less than or equal to

Logical operators in C language:

OperatorsWhat they meanResults
&&Logical ANDTrue when all operands are true
||Logical ORTrue only if either one operand is true
!Logical NOTTrue when operand is zero

Related Posts

Leave a comment