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. |
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. |
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. |
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
|
Syllabus Covered in this section is
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 -
Various Search Terms used for this section are