Patterns CH

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

PATTERNS IN C++

apna college
SQUARE INT return 0;
}
#include<iostream>
using namespace std;
int main() SQUARE CONT
{ #include<iostream>
int n=4,z; using namespace std;
for(int i=0;i<n;i++){ int main()
z=1; {
for(int j=0;j<n;j++){ int n=3,z=1;
cout<<z; for(int i=0;i<n;i++){
z++;
} for(int j=0;j<n;j++){
cout<<endl; cout<<z;
} z++;
return 0; }
} cout<<endl;
}
SQUARE CH return 0;
}
#include<iostream>
using namespace std;
int main() SQUARE CONT CH
{ #include<iostream>
int n=4; using namespace std;
for(int i=0;i<n;i++){ int main()
char ch='A'; {
for(int j=0;j<n;j++){ int n=3;
cout<<ch; char ch='A';
ch=ch+1; for(int i=0;i<n;i++){
}
cout<<endl; for(int j=0;j<n;j++){
} cout<<ch;
return 0; ch=ch+1;
} }
cout<<endl;
SQUARE * }
return 0;
#include<iostream>
}
using namespace std;
int main()
{ TRIANGLE *
int n=4; #include<iostream>
for(int i=0;i<n;i++){ using namespace std;
for(int j=0;j<n;j++){ int main()
cout<<"*"; {
} int n=9;
cout<<endl; for(int i=0;i<n;i++){
} for(int j=0;j<i;j++){
PATTERNS IN C++
apna college
cout<<"*"; {
int n=4,l;
} for(int i=0;i<n;i++){
cout<<endl; for(int j=1;j<=i+1;j++){
} cout<<j;
return 0;} }
cout<<endl;
TRIANGLE }
return 0;
1,22,333 }
#include<iostream>
using namespace std; Triangle reverse
int main()
#include<iostream>
{
using namespace std;
int n=9,;
int main()
for(int i=0;i<n;i++){
{
int n=4,l;
for(int j=0;j<i;j++){
for(int i=0;i<n;i++){
cout<<i;
for(int j=i+1;j>0;j--){
}
cout<<j;
cout<<endl;
}
}
cout<<endl;
return 0;
}
}
return 0;
}
TRIANGLE
A,BB,CCC
#include<iostream> FLOYD’S TRIANGL
using namespace std; #include<iostream>
int main() using namespace std;
{ int main()
int n=9; {
char ch='A'; int n=5,l=1;
for(int i=0;i<n;i++){ for(int i=0;i<n;i++){
for(int j=0;j<=i;j++){ for(int j=0;j<i;j++){
cout<<ch; cout<<l;
} l++;
ch=ch+1; }
cout<<endl; cout<<endl;
} }
return 0; return 0;
} }

TRIANGLE INT FLOYD’S TRIANGLE CHAR


#include<iostream> #include<iostream>
using namespace std; using namespace std;
int main() int main()
PATTERNS IN C++
apna college
{ return 0;
int n=5,l=1; }
char ch='A';
for(int i=0;i<n;i++){ INVERTED TRIANGLE
for(int j=0;j<i;j++){
cout<<ch; CHAR
ch=ch+1; #include<iostream>
} using namespace std;
cout<<endl; int main()
} {
return 0; int n=4,l,j;
} char ch ='A';
for(int i=0;i<n;i++){
for(j=0;j<i;j++){
Triangle reverse char cout<<" ";
}
#include<iostream>
for (j=0;j<n-i;j++){
using namespace std;
cout<<ch;
int main()
}ch=ch+1;
{
cout<<endl;
int n=4;
}
for(int i=0;i<n;i++){
return 0;
char ch='A'+i;
}
for(int j=0;j<=i;j++){
cout<<ch;
ch=ch-1; PYRAMID
} #include<iostream>
cout<<endl; using namespace std;
} int main()
return 0; {
} int n=9,j,k;
for (int i=0; i<n; i++){
INVERTED TRIANGLE for (int j=0; j<n-i-1; j++ ){
cout<<" ";
#include<iostream>
}
using namespace std;
for(int j=1;j<=i+1; j++){
int main()
cout<< j <<" ";
{
}
int n=4,l,j;
for (int j=i ;j>0; j--){
cout<<j<<" ";
for(int i=0;i<n;i++){
}
for(j=0;j<i;j++){
cout<< endl;
cout<<" ";
}
}
return 0;
for (j=0;j<n-i;j++){
}
cout<<(i+1);
}
cout<<endl; CHAR PYRAMID
} #include<iostream>
using namespace std;
PATTERNS IN C++
apna college
int main()
{
int n=4,j,k;
char ch='A';
for (int i=0; i<n; i++){
for (int j=0; j<n-i-1; j++ ){
cout<<" ";
}
for(int j=1;j<=i+1; j++){
ch=ch+j;
cout<<ch;
}

cout<< endl;
}
return 0;
}

remaining

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy