A B C D E F G G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
-----------------------------------
#include
#include
int main( )
{
int r,c,askey;
clrscr( );
for( r=7; r>=1; r-- )
{
askey=65;
for(c=1; c<=r; c++ )
printf("%2c", askey++ );
askey--;
for(c=r; c>=1; c-- )
printf("%2c", askey--);
printf("\n");
}
getch();
return 0;
}
Output:-
A B C D E F G G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
Note:-
'r' and 'c' means rows and columns .
'askey' variable is for disp. values.
#vpsinghrajput
Author & Editor
Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.
Here i am trying to solve a question. I want to make a program in C++ format(not in C format) which results in a PYRAMID OF ALPHABETS as shown below:
ReplyDeleteA
AB
ABC
ABCD
ABCDE
I have found a similar solution for this problem but that was in C language format not in C++ format. I will b thankfull to u if u provide me the solution in C++ format.
C PROGRAM TO PRINT ALPHABETS IN FOLLOWING FASHION
ReplyDeleteABCDEFGHIJKLMNOPQRSTUVWXYZ
BCDEFGHIJKLMNOPQRSTUVWXY
CDEFGHIJKLMNOPQRSTUVWX
DEFGHIJKLMNOPQRSTUVW
EFGHIJKLMNOPQRSTUV
FGHIJKLMNOPQRSTU
GHIJKLMNOPQRST
HIJKLMNOPQRS
IJKLMNOPQR
JKLMNOPQ
#include
ReplyDeleteint main( )
{
int r,c,askey,j=0;
for( r=j; r<=25;r++)
{
askey=65+r;
for(c=r; c<=25; c++ )
printf("%2c", askey++ );
printf("\n");
}
return 0;
}
A
ReplyDeleteA A
A A A
A A
CODE NEEDED...PLZ HELP
to print any size of pattern of "A"
ReplyDeleteA
ReplyDeleteABA
ABCBA
ABCDCBA
give the code for this
A B C D E F G G F E D C B A
ReplyDeleteA B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
#include
using namespace std;
main()
{
int no=65;
for(int row=71;row>=no;row--)
{
for(int a=65;a<=row;a++)
cout<<(char) a<<" ";
for(int b=row;b>=65;b--)
cout<<(char) b<<" ";
cout<<endl;
}
}
c programming example codes
ReplyDeletec ptogram code Printint a double pyramid