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 is null pointer and void pointer and what is their use?
What is the C-style character string?
How a new element can be added or pushed in a stack?
How one would use switch in a program?
What is istream and ostream in c++?
What is the difference between a baller and a reference in C++?
Why is "using namespace std;" considered bad practice?
What is abstraction with real time example?
What is the role of copy constructor in copying of thrown objects?
How can virtual functions in c++ be implemented?
Which bitwise operator is used to check whether a particular bit is on or off?
What is the difference between ++ count and count ++?
What is the difference between the functions memmove() and memcpy()?
What does iomanip mean in c++?
What do you mean by “this” pointer?