Explore the new and unique programing techniques with just a click and u can visit DEVGROUP , COMPUTERS & TECHNOLOGY, ARTIFICIAL INTELLIGENCE,PROTECT HACKINGand FACEBOOK PAGE
Tuesday, 4 December 2012
Alphabet pattern
#include<iostream>
using namespace std;
#include<conio.h>
#include<math.h>
int main()
{
int k=-1,j;
char i,m=71,n=65;
for(int x=1;x<=7;x++) //for number of lines 7
{
for(i=65;i<=m;i++) //for displaying A B C ...
{
cout<<i<<" ";
}
for(j=1;j<=k;j++) //for displaying spaces
{
cout<<" ";
}
k=k+2;
if(i==72)
{
i--;
}
i--;
for(;i>=n;i--) //for displaying alphabets in reverse
{
cout<<i<<" ";
}
m--;
cout<<"\n";
}
getch();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment