Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program in c to print
1
121
12321
1234321
123454321

Answer Posted / sabby

#include<stdio.h>
main()
{
int i,j,s,n;
printf("Enter the number of rows:");
scanf("%d\n",&n);
for(i=1;i<=n;i++)
{
for(s=1;s<=n-i;s++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d",j);
j=j-2;
for(;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
}

Is This Answer Correct ?    16 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of sizeof?

1004


What does emoji p mean?

1100


Where are local variables stored in c?

1023


Why is c so powerful?

1104


What is default value of global variable in c?

971


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

1138


what is the different bitween abap and abap-hr?

2301


How can I read and write comma-delimited text?

1063


What are integer variable, floating-point variable and character variable?

1234


What is the sizeof () operator?

1065


How do I determine whether a character is numeric, alphabetic, and so on?

1117


List the variables are used for writing doubly linked list program.

2015


What is a structure in c language. how to initialise a structure in c?

1053


What are the types of functions in c?

974


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1319