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 is data hiding c++?

601


What is meant by entry controlled loop?

660


What is a local variable?

580


How a pointer differs from a reference?

692


What does the linker do?

597






If there are two catch statements, one for base and one for derived, which should come first?

580


What is the difference between delegation and implemented-in-terms-of?

525


Should I learn c or c++ or c#?

559


write a function signature with various number of parameters.

567


What is rvalue?

678


Show the application of a dynamic array with the help of an example.

588


What is c++ programming language?

580


What is input operator in c++?

589


Explain unexpected() function?

584


Why the usage of pointers in C++ is not recommended ?

900