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 / ayas kumar das

#include"stdio.h"
int main()
{
int i,j,n;
printf("enter the number :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
if(i>1)
{
for(j=i;j>1;)
{
printf("%d",j-1);
j=j-1;
}
}
printf("\n");
}
return 0;
}

Is This Answer Correct ?    12 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are # pragma staments?

2082


Is c++ based on c?

1133


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1191


What is a program?

1341


How can I direct output to the printer?

1374


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3608


Should a function contain a return statement if it does not return a value?

1138


What is the difference between volatile and const volatile?

1051


What are enums in c?

1289


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

1399


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

1332


What are multibyte characters?

1192


how logic is used

2024


What is the difference between far and near in c?

1121


How to write c functions that modify head pointer of a linked list?

1036