Classical

C Programming MCQ - Decision Making & Looping

1:  

What is the following code segment doing?

void fn( )
{
char c;
cin.get(c);
if (c != ‘\n’)
{
    fn( );
    cout.put(c);
}
}

A.

The string entered is printed as it is.

B.

The string entered is printed in reverse order.

C.

It will go in an infinite loop.

D.

It will print an empty line.

 
 

Option: B

Explanation :


2:   For loop in a C program, if the condition is missing
A. it is assumed to be present and taken to be false
B. it is assumed to be present and taken to the true
C. it result in a syntax error
D. execution will be terminated abruptly
 
 

Option: B

Explanation :


3:   Which of the following statement about for loop is true ?
A. Index value is retained outside the loop
B. Index value can be changed from within the loop
C. Goto can be used to jump, out of the loop
D. All of these
 
 

Option: D

Explanation :


4:  

If c is a variable initialised to 1, how many times will the following loop be executed?

while ((c > 0) && (c < 60))
{
loop body
c ++;
}

A.

60

B.

59

C.

61

D.

None of these

 
 

Option: B

Explanation :


5:  

How many times will the following loop be executed if the input data item is 0 1 2 3 4 ?

while (c = getchar ()! = 0)
{ }

A.

Ininitely

B.

never

C.

once

D.

None of these

 
 

Option: A

Explanation :




Suggest an improvement

 


Syllabus Covered in this section is

  • Elements of C-Tokens
  • Identifiers
  • data types in C
  • Control structures in, C
  •  Sequence, selection and iteration(s).
  • Structured data types in C
  • Arrays, Structures, union, String, and pointers
  • Functions, Recursion
  • Parameter passing, Scope
  •  Binding, Abstract data types

This Section covers Multiple Choice Questions Answers in C Programming . Here questions answers are given with explanation and references. These questions can be used for the preparation of various competitive and academic exams.

Who can benefit - 

  • Any undergraduate or postgraduate student who is seeking C Programming objective type questions answers can use this section.
  • C programming Multiple Choice questions Answers can help you in interview preparation.
  • C Programming Objective type Questions Answers are also used at SSC and HSc level for Exam preparation.
  • C Programming MCQ Questions Answers are also used by engineering students in the preparation of their Exams.
  • Any candidate who has to appear for DOEACC A, B or C level Exam can also learn C Programming Questions Answers.
  • All the teachers who are appearing for Kendriya Vidyalya Sangathan Entrance Exam can also use C Programming Multiple Choice Questions Answers.
  • C Programming MCQs can also be used by the students who are pursuing B.Sc or Msc Computer Science.
  • C Programming Questions Answers can also be used by BCA students for the preparation of their exams.
  • Any student who is pursuing B.Sc. in Information Technology can also use this C Programming mcq Questions Answers.
  •  MCA students can also prepare for their exams using  C Programming Objective Type Questions Answers.
  • You can get free access to C Programming mcq pdf.
  • You can also have online access to C Programming Questions Answers EBook.

Various Search Terms used for this section are

  • C Programming quiz questions with answers

  • C Programming exam questions answers

  • C Programming MCQ questions Answers

  • C Programming MCQ

  • C Programming Questions Answers