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


Please Help Members By Posting Answers For Below Questions

‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1879


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

712


Write a progarm to find the length of string using switch case?

1612


What is use of integral promotions in c?

666


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

726






What is the meaning of c in c language?

596


What is queue in c?

578


shorting algorithmS

1803


What is the main difference between calloc () and malloc ()?

573


What is c programming structure?

620


Why does everyone say not to use scanf? What should I use instead?

681


What is meant by gets in c?

609


What is #define used for in c?

615


What are c header files?

581


What is selection sort in c?

611