program to print this triangle
*
* *
* * *
Answer Posted / saravana kumar
void main()
{
int i , j , k ;
for(i = 0 ; i < 3 ; i++)
{
for (k = 2 ; k >= i ; k--)
{
printf (" ") ;
}
for(j = 0 ; j<= i ; j++)
{
printf ("* " , i , j) ;
}
printf ("\n") ;
}
| Is This Answer Correct ? | 7 Yes | 13 No |
Post New Answer View All Answers
Why cstdlib is used in c++?
What are the manipulators in c++?
Do you know what is overriding?
Can a function take variable length arguments, if yes, how?
Are there interfaces in c++?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
What is difference between class and function?
How can we access protected and private members of a class?
Is c++ vector dynamic?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
What is fflush c++?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
How do you find out if a linked-list has an end?
How do you declare A pointer to a function which receives nothing and returns nothing
Discussion on error handling of C++ .