0% found this document useful (0 votes)
1 views

source code

The document contains a C++ program that prints a formatted output based on nested loops. It uses conditional statements to determine the values displayed for each row based on the row index. The program aims to generate a specific pattern in the console output.

Uploaded by

dmbdchr95w
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

source code

The document contains a C++ program that prints a formatted output based on nested loops. It uses conditional statements to determine the values displayed for each row based on the row index. The program aims to generate a specific pattern in the console output.

Uploaded by

dmbdchr95w
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <iostream>
#include <iomanip>

int main()
{
for (int 1 = 0; i < 6; j++) {
for (int j = 0; j < 6; j++) {
if (i % 2 == 0) {
if (i == 0)
cout << setw(4) <<
setfill(' ') << j + 1;
else
cout << setw(4) <<
setfill(' ') << j + 1;
} else {
if (i == 1)
cout << setw(4) <<
setfill(' ') << j * 2 + 22;
else if (i == 3)
cout << setw(4) <<
setfill(' ') << j * 2 + 14;
else if (i == 5)
cout << setw(4) <<
setfill(' ') << j * 2 + 6;
}
}
cout << endl;

return 0;
}

You might also like