0% found this document useful (0 votes)
27 views3 pages

Alpan Source

The document contains C++ code that uses loops and conditional statements to output patterns of asterisks and spaces across multiple lines, printing different patterns on consecutive sets of lines.

Uploaded by

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

Alpan Source

The document contains C++ code that uses loops and conditional statements to output patterns of asterisks and spaces across multiple lines, printing different patterns on consecutive sets of lines.

Uploaded by

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

#include <iostream>

using namespace std;

int main()

for (int i=0;i<10;i++){

for (int d=0;d<10;d++){

if ((i==0&&d>=4&&d<=5)||

(i==1&&d>=3&&d<=6)||

(i==2&&d>=2&&d<=3)||

(i==2&&d>=6&&d<=7)||

(i==3&&d>=1&&d<=2)||

(i==3&&d>=7&&d<=8)||

(i==4&&d>=0&&d<=1)||

(i==4&&d>=8&&d<=9)||

(i==5&&d>=0&&d<=9)||

(i==5&&d>=0&&d<=9)||

(i==6&&d>=0&&d<=9)||

(i==7&&d>=0&&d<=1)||

(i==7&&d>=8&&d<=9)||

(i==8&&d>=0&&d<=1)||

(i==8&&d>=8&&d<=9)||

(i==9&&d>=0&&d<=1)||

(i==9&&d>=8&&d<=9)){

cout<<"*";

else {

cout<<" ";

} cout<<endl;
}

cout<<endl;

cout<<endl;

for (int i=0;i<10;i++){

for (int d=0;d<10;d++){

if ((i==0&&d>=0&&d<=4)||

(i==1&&d>=0&&d<=1)||

(i==1&&d>=4&&d<=5)||

(i==2&&d>=0&&d<=1)||

(i==2&&d>=4&&d<=5)||

(i==3&&d>=0&&d<=1)||

(i==3&&d>=4&&d<=5)||

(i==4&&d>=0&&d<=4)||

(i==5&&d>=0&&d<=4)||

(i==6&&d>=0&&d<=1)||

(i==6&&d>=4&&d<=5)||

(i==7&&d>=0&&d<=1)||

(i==7&&d>=4&&d<=5)||

(i==8&&d>=0&&d<=1)||

(i==8&&d>=4&&d<=5)||

(i==9&&d>=0&&d<=4)){

cout<<" *";

else {

cout<<" ";

} cout<<endl;

}
cout<<endl;

cout<<endl;

for (int i=0; i<11; i++){

for (int j=0; j<11; j++){

if ((i==0&&j>=5&&j<=5)||

(i==1&&j>=4&&j<=6)||

(i==2&&j>=3&&j<=4)||

(i==2&&j>=6&&j<=7)||

(i==3&&j>=2&&j<=3)||

(i==3&&j>=7&&j<=8)||

(i==4&&j>=1&&j<=2)||

(i==4&&j>=8&&j<=9)||

(i==5&&j>=0&&j<=1)||

(i==5&&j>=9&&j<=10)||

(i==6&&j>=1&&j<=2)||

(i==6&&j>=8&&j<=9)||

(i==7&&j>=2&&j<=3)||

(i==7&&j>=7&&j<=8)||

(i==8&&j>=3&&j<=4)||

(i==8&&j>=6&&j<=7)||

(i==9&&j>=4&&j<=6)||

(i==10&&j>=5&&j<=5)){

cout<<" *";

else { cout<<" ";}

} cout<<endl;

You might also like