Please tell me how to print this triangle in c++....?
-
A AB ABC ABCD ABCDE ABCDEF
-
Answer:
One for loop controls the width, the other controls the height. That's all you need to know.
sakshamk... at Yahoo! Answers Visit the source
Other answers
Hi, The following will print an alphabet triangle: #include<stdio.h> #include<conio.h> void main() { int i,j; int n; clrscr(); printf("Enter the ASCII character\t"); scanf("%d",&n); for(i=65;i<=n;i++) { for(j=65;j<=i;j++) printf("%c",i); printf("\n"); } getch(); } Note though that the out put would look like this: A BB CCC DDDD EEEEE FFFFFF I'm sure you can modify the loop to print what you want :) Regards, TgTips
Related Q & A:
- How to print a large image in C#?Best solution by Stack Overflow
- Could anyone please tell me what i can do to speed up my yahoo mail it used to be fast but now slow?Best solution by Yahoo! Answers
- Can you please tell me why the expressive social style is the most important one?Best solution by answers.yahoo.com
- Can you please tell me if the NET test is hard?Best solution by answers.yahoo.com
- Can please someone tell me how can I repair my computer?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.