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

Who invented turbo c++?

603


What is difference between rand () and srand ()?

588


What is a block in c++?

546


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

564


Define a nested class.

611






Can a Structure contain a Pointer to itself?

608


Comment on c++ standard exceptions?

630


What is the use of 'this' pointer?

765


Specify some guidelines that should be followed while overloading operators?

616


Explain how we implement exception handling in c++?

573


What are the c++ access specifiers?

767


What is type of 'this' pointer? Explain when it is get created?

586


Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.

609


What is :: operator in c++?

576


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

608