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

Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?

1586


Is c++ double?

566


What is switch case in c++ syntax?

624


Is map ordered c++?

596


Can we sort map in c++?

596






What are the various operations performed on stack?

631


Define pure virtual function?

564


Explain the advantages of using friend classes.

594


Discussion on error handling of C++ .

648


What is the best c++ book for beginners?

578


What is the iunknown interface?

680


Which is most difficult programming language?

582


Why should you learn c++?

587


To which numbering system can the binary number 1101100100111100 be easily converted to?

608


What is lambda expression c++?

578