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 :

Click on Discuss to view users comments.

Write your comments here:



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 :

Click on Discuss to view users comments.

Write your comments here:



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 :

Click on Discuss to view users comments.

Write your comments here:



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 :

Click on Discuss to view users comments.

sonali manohar shelke said: (8:02am on Monday 18th December 2017)
As here condition is given as C is greater than 0 and less than 60 which means its starting from 1 and end to 59,hence it will execute upto 59

Write your comments here:



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 :

Click on Discuss to view users comments.

Write your comments here:




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