Nested Loops-Programming For Engineers II-Quiz Solution, Exercises of Programming for Engineers

Sir Prachur Sharma took this quiz in class of Programming for Engineers course at Bhagwant University Rajasthan. It includes: Nested, Loop, Display, Output, Program, Integer, Loop, Repetition, Conditional, Statement, Nested

Typology: Exercises

2011/2012

Uploaded on 07/25/2012

anasuya
anasuya 🇮🇳

4

(9)

85 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Quiz # 2
(Programming-ll-EE112)
Time: 10 minutes Date: 06.02.09
Marks: 10
1. Write nested loops that displays the output below.
0
01
0123
01234
0123
012
01
0
#include <iostream.h>
void main()
{
// int a[4];
//for (int i=0;i<8;i++)
// {
for (int j=0;j<10;j++)
{
if (j<6)
{
for (int k=0;k<j;k++)
{
cout<<k;
}
cout<<endl;
}
else
{
for (int l=0;l<10-j;l++)
{
cout<<l;
}
cout<<endl;
}
}
// }
}
docsity.com

Partial preview of the text

Download Nested Loops-Programming For Engineers II-Quiz Solution and more Exercises Programming for Engineers in PDF only on Docsity!

Quiz # 2

(Programming-ll-EE112)

Time: 10 minutes Date: 06.02.

Marks: 10

1. Write nested loops that displays the output below.

#include <iostream.h> void main() { // int a[4]; //for (int i=0;i<8;i++) // { for (int j=0;j<10;j++) { if (j<6) { for (int k=0;k<j;k++) { cout<<k; } cout<<endl; } else { for (int l=0;l<10-j;l++) { cout<<l; } cout<<endl; } } // } }

docsity.com