|
| ||||||||||
| Tags: print, triangle |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Want To Print Triangle In C++
is there any way to print triangle in c++ like this : * * * * * * * * * * * * * * * |
|
#2
| |||
| |||
| Re: Want To Print Triangle In C++
hi, try this program this will print the output in traingle of '*' from left to right. do the same thing to print '*' traingle from right to left just inverse the loop. Code: # include <iostream>
#include <conio.h>
int printStars (int f,int g,int h);
int main ()
{
printStars(f, g, h);
return 0;
}
int printStars (int f,int g,int h)
{
int f, g, h;
for (f=1; f<=5; f++)
{
for (h= 4; h >=0; h--)
{
cout<<" ";
while (g=0)
{
for (g=1; g<=lines; g++)
}
{
cout<<"* ";
}
}
cout<<endl;
}} |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Want To Print Triangle In C++" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need C program to print triangle of character or number | Khan Baba | Software Development | 5 | 17-09-2011 04:40 PM |
| Triangle generator | gelsys1208 | Software Development | 3 | 13-10-2010 04:32 AM |
| Triangle using C++ | Brake Fail | Software Development | 4 | 04-02-2009 10:54 PM |
| Yellow triangle in the taskbar | harakim | Windows Software | 3 | 03-10-2008 03:09 PM |
| Print spooler hangs when trying to print from a shared print | Jisbomb | Windows XP Support | 3 | 27-07-2007 10:17 PM |