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


Please Help Members By Posting Answers For Below Questions

What are the advantages of using typedef in a program?

638


List the merits and demerits of declaring a nested class in C++?

607


If I is an integer variable, which is faster ++i or i++?

586


What is the most common mistake on c++ and oo projects?

515


Refer to a name of class or function that is defined within a namespace?

601






What are disadvantages of pointers?

563


What is a c++ class?

611


What is a container class?

617


How can an improvement in the quality of software be done by try/catch/throw?

587


What is an arraylist c++?

687


What is a local reference?

669


Is facebook written in c++?

559


What is the benefit of learning c++?

545


What language does google use?

584


Is it possible to get the source code back from binary file?

708