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 does. int *x[](); means ?
How does placing some code lines between the comment symbol help in debugging the code?
What is a floating point in c?
What do you understand by normalization of pointers?
What is variable and explain rules to declare variable in c?
Why cant I open a file by its explicit path?
what is a function method?give example?
Why dont c comments nest?
What is use of pointer?
Explain union. What are its advantages?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
What are valid operations on pointers?
Is r written in c?
What are the properties of union in c?
What are the 5 elements of structure?