how to print this pyramid *
*
*
* * * * * * *
*
*
*
Answer Posted / j.n.abhishek
void main()
{
int n,i,j;
clrscr();
printf("ENTER THE LIMIT:");
scanf("%d",&n);
for(i=0;i<=(2*n);i++)
{
if(i!=n)
{
for(j=0;j<(2*n);j++)
{
printf(" ");
}
printf("+\n");
}
else
{
for(j=0;j<=(2*n);j++)
{
printf("+ ");
}
printf("\n");
}
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is the difference between constant pointer and constant variable?
What are global variables and explain how do you declare them?
What is the symbol indicated the c-preprocessor?
how we can make 3d venturing graphics on outer interface
What is the importance of c in your views?
When should the const modifier be used?
using only #include
Differentiate fundamental data types and derived data types in C.
What is dangling pointer in c?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What is the explanation for prototype function in c?
What is a nested formula?
Explain main function in c?
How do I create a directory? How do I remove a directory (and its contents)?
Can you please compare array with pointer?