Programming in C - Decision Making and Looping

1. What is the following code segment doing?
void fn( )
{
char c;
cin.get(c);
if (c != ‘\n’)
{
fn( );
cout.put(c);
} }

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


2. For loop in a C program, if the condition is missing

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


3. Which of the following statement about for loop is true?

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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 ++;
}

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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)
{ }

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


  • C Programming Practice Questions can be used to give quizzes by any candidate who is preparing for UGC NET Computer Science
  • This C Programming Practice Questions section will help you test your analytical skills in a tricky method, thereby giving you an edge over other students
  • Any student who wants to prepare for DOEACC A Level, DOEACC B Level, and DOEACC C level can also use these Objective Type Questions Answer.
  • All candidates who have to appear for the Kendriya Vidyalaya Entrance exam can also refer to this mcq section.
  • You can also get access to the C Programming Practice MCQ ebook.
  • C Programming Practice Questions can be used in the preparation of JRF, CSIR, and various other exams.
  • You can also download pdf for these C Programming Practice multiple-choice questions Answers.
  • This C Programming Practice Multiple Choice Questions Answers section can also be used for the preparation of various competitive exams like UGC NET, GATE, PSU, IES, and many more.
  • C Programming Practice Questions can be used to gain a credit score in various undergraduate and postgraduate courses like BSc, MSc and MCA
  • C Programming Practice Questions for UGC NET Computer Science

    C Programming Practice MCQ

    C Programming Practice Multiple choice questions