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
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Write a progarm to find the length of string using switch case?
What is use of integral promotions in c?
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
What is the meaning of c in c language?
What is queue in c?
shorting algorithmS
What is the main difference between calloc () and malloc ()?
What is c programming structure?
Why does everyone say not to use scanf? What should I use instead?
What is meant by gets in c?
What is #define used for in c?
What are c header files?
What is selection sort in c?