program to print this triangle
*
* *
* * *

Answer Posted / amit

/* Display Following Output
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * * * */

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,r;
clrscr();

printf("\n\t Enter the raw number for Making Pyramind =>");
scanf("%d",&r);

printf("\n\n\n\n");

for(i=0;i<r;i++)
{
for(k=r;k>=i;k--)
{
printf(" ");
}
for(j=0;j<=i;j++)
{
printf(" *",i,j);
}
printf("\n");

}
getch();
}

Is This Answer Correct ?    12 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is rtti in c++?

836


What is a tree in c++?

726


What is the error in the code below and how should it be corrected?

520


Can you explicitly call a destructor on a local variable?

788


What are the types of container classes?

805


Const char *p , char const *p What is the difference between the above two?

914


What is c++ map?

754


Is facebook written in c++?

749


What is the best c++ book for beginners?

814


What is the use of data hiding?

772


Why is c++ awesome?

798


What is the type of this pointer in c++?

814


What is a wchar_t in c++?

807


How java is different from c and c++?

918


What is encapsulation in C++? Give an example.

810