Programmer

Friday, 29 June 2018

Pattern Using Intersections.!

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
int i,j,n,temp=1;
clrscr();
cout<<"Enter Number :";
cin>>n;
cout.setf(ios::right);
for(i=1;i<n*2;i++)
{
for(j=1;j<n*2;j++)
{
if(i+j<=n||i-j>=n||j-i>=n||i+j>=n*3)
{
cout<<setw(3)<<temp++;
}
else
{
textcolor(RED);
cprintf(" * ");
textcolor(7);
}
}
cout<<endl;
}
getch();
}


No comments:

Post a Comment

Program To Print Particular Line From File.

#include<fstream.h> #include<conio.h> #include<stdlib.h> void main() { ifstream fin; int count=0,num,l=1; char ...