program to print this triangle
*
* *
* * *
Answer Posted / prasenjit roy
void DrawStar(int Count)
{
int i,j;
for ( i = 1; i<=Count; i++ )
{
for ( j = i; j<Count ; j++ )
printf(" ");
for ( j = 1; j<=i; j++ )
printf("* ");
printf("\n");
}
}
int main(int argc, char* argv[])
{
DrawStar(3);
return 0;
}
Is This Answer Correct ? | 40 Yes | 10 No |
Post New Answer View All Answers
What are the advantages of using typedef in a program?
List the merits and demerits of declaring a nested class in C++?
If I is an integer variable, which is faster ++i or i++?
What is the most common mistake on c++ and oo projects?
Refer to a name of class or function that is defined within a namespace?
What are disadvantages of pointers?
What is a c++ class?
What is a container class?
How can an improvement in the quality of software be done by try/catch/throw?
What is an arraylist c++?
What is a local reference?
Is facebook written in c++?
What is the benefit of learning c++?
What language does google use?
Is it possible to get the source code back from binary file?