Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main ()
4.
{
5.
int n;
6.
for (n = 5; n > 0; n--)
7.
{
8.
cout
Options:
A .  543
B .  54
C .  5432
D .  53
Answer: Option A

Inthis program, We are printing the numbers in reverse order but by using break statement we 

stopped printing on 3.
Output:
$ g++ stat.cpp
$ a.out
543



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers