answersLogoWhite

0

Function to print star triangle in c++

#include
#include
void starfunction(int); //You can give any function name

void main()
{
int a;
clrscr();
cout<<"Enter number of rows required:";
cin>>a;
star(a);
getch();
}

void starfunction(int r )
{
for(int i=1;i<=r;i++)
{
for(int j=1;j<=i;j++)
{
cout<<"*";
}
cout<<"\n";
}
}

Function to print star triangle in c

#include
#include
void starfunction(int); //You can give your own function name

void main()
{
int a;
clrscr();
printf("Enter number of rows required:");
scanf("%d",&a);
star(a);
getch();
}

void starfunction(int r )
{
int i,j;
for( i=1;i<=r;i++)
{
for( j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


How do you print a triangle of stars?

write a c++ programe to print a triangle without (for)


How do you write a program to print numbers from star one and next line star two in php?

Try the triangle program on a search engine. Replace numbers with stars and that should do the trick


Write a for loop in C to print the 7 stars row?

... int i; for( i = 0; i &lt; 7; ++i ) { printf("*"); } printf("\n"); ...


Is WWE all-stars in Kuwait?

a cheat for ps3 is to unlock everything is at the main menu press &lt;, triangle, down, &lt;, triangle, square, &lt;, square, triangle, down, &gt;, square, &lt;, up, square, &gt; please try it it really really really works i tried it u kno how sum people lie I'm not caus its stupid so try it please this sign is over p.s print this page or write it down to save paper


What three stars make up the Summer Triangle?

The three stars that make up The Summer Triangle are: Vega, Altair, and Deneb.Look below at Sources and related links to see the stars and constellations of The Summer Triangle.


How do you write 4 and a half stars?

To write &quot;4 and a half stars,&quot; you can use a combination of numeric and symbolic representations. You might write it as &quot;4.5 stars&quot; or &quot;4½ stars.&quot; Alternatively, you can express it in words as &quot;four and a half stars.&quot;


What are the three Stars that make up winter triangle?

The three stars are Sirius, Betelgeuse and Procyon.


Pictures of nautical stars to print out?

See related link for a star map


What is the function of the papulae in the sea stars?

digestion


How do you write stars in German?

Sterne


Is it illegal to write to movie stars?

No.