64. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 char i,j,k;                 int n,x,y=1;                 clrscr();                 cout<<"Enter The Number of Line :- ";                 cin>>n;                 k='A'+(n-1);                 for(i='A';i<=k;i++)                                 {                                 cout<<endl;                                 for(x=1;x<=n-y;x++)                                                 {                                                 cout<<" ";                                                 }                                 y++;                                 for(j='A';j<=i;j++)                                                 {                                                 cout<<j<<" ";                                                 }                                 }                 getch(); … Continue reading 64. Write a program to print the following pattern?

Advertisements

63. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,n;                 clrscr();                 cout<<"Enter The Number of Line :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(j=1;j<=n-i;j++)                                                 {                                                 cout<<"* ";                                                 }                                 for(j=1;j<=(2*i-1);j++)                                                 {                                                 cout<<"  ";                                                 }                                 for(j=1;j<=n-i;j++)                                                 {                                                 cout<<"* ";                                                 }                                 } … Continue reading 63. Write a program to print the following pattern?

62. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,n;                 clrscr();                 cout<<"Enter The Number of Line : ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(j=1;j<=n-i;j++)                                                 {                                                 cout<<"  ";                                                 }                                 for(j=1;j<=(2*i-1);j++)                                                 {                                                 cout<<"* ";                                                 }                                 }                 for(i=1;i<=n-1;i++)                                 {                                 cout<<endl;                                 for(j=1;j<=i;j++)                                                 … Continue reading 62. Write a program to print the following pattern?

61. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,n,num;                 clrscr();                 cout<<"Enter The Number of Line :- ";                 cin>>num;                 n=num;                 for(i=1;i<=num;i++)                                 {                                 cout<<endl;                                 for(j=1;j<i;j++)                                                 {                                                 cout<<"  ";                                                 }                                 for(j=1;j<=2*(n-i)+1;j++)                                                 {                                                 cout<<"* ";                                                 }                                 }                 getch(); }

60. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,n;                 clrscr();                 cout<<"Enter The Number of Line :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(j=1;j<=n-i;j++)                                                 {                                                 cout<<" ";                                                 }                                 for(j=1;j<=i;j++)                                                 {                                                 if((i+j)%2==0)                                                                 {                                                                 cout<<"1 ";                                                                 }                                                 else                                                                 {                                                                 cout<<"0 "; … Continue reading 60. Write a program to print the following pattern?

59. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,n;                 clrscr();                 cout<<"Enter The Number of Line :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(j=1;j<=i;j++)                                                 {                                                 if((i+j)%2==0)                                                                 {                                                                 cout<<"1 ";                                                                 }                                                 else                                                                 {                                                                 cout<<"0 ";                                                                 }                                                 }                                 }                 getch(); }

58. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,k=4,n;                 clrscr();                 cout<<"Enter The Length of Pattern :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(j=1;j<=i;j++)                                                 {                                                 cout<<k++<<" ";                                                 }                                 }                 getch(); }

57. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,k,n;                 clrscr();                 cout<<"Enter The Length of Pattern :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(k=1;k<=i;k++)                                                 {                                                 cout<<i<<" ";                                                 if(n>=10)                                                                 {                                                                 if(i>9)                                                                                 {}                                                                 else                                                                                 {                                                                                 cout<<" ";                                                                                 }                                                                 }                                                 }                                 … Continue reading 57. Write a program to print the following pattern?

56. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,k,n;                 clrscr();                 cout<<"Enter The Length of Pattern :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<"\n";                                 for(k=1;k<=n-i;k++)                                                 {                                                 cout<<" ";                                                 }                                 for(j=1;j<=i;j++)                                                 {                                                 if(i==j)                                                                 {                                                                 cout<<"*";                                                                 }                                                 else                                                                 {                                                                 cout<<"* ";                                                                 … Continue reading 56. Write a program to print the following pattern?

55. Write a program to print the following pattern?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,k,n;                 clrscr();                 cout<<"Enter The Length of pattern :- ";                 cin>>n;                 for(i=1;i<=n;i++)                                 {                                 cout<<endl;                                 for(k=1;k<=n-i;k++)                                                 {                                                 cout<<" ";                                                 }                                 for(j=1;j<=i;j++)                                                 {                                                 cout<<j<<" ";                                                 }                                 }                 getch(); }