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 / roshan patil

#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,k,num;
cout<<num;
for(i=1;i<=num;i++)
{
for(j=1;j<num-1;j++)
{
cout<<" ";
}
for(k=1;k<i;k++)
{
cout<<k;
}
for(k=i;k>=1;k--)
{
cout<<k;
}
}
}

Is This Answer Correct ?    12 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write a multi-statement macro?

988


write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.

3767


What are loops c?

996


Explain what is a 'locale'?

1015


How can I implement a delay, or time a users response, with sub-second resolution?

1033


Explain the array representation of a binary tree in C.

1166


How many data structures are there in c?

1064


What is void pointers in c?

957


Is c compiled or interpreted?

1128


Are the outer parentheses in return statements really optional?

1049


How can I implement sets or arrays of bits?

988


List some of the dynamic data structures in C?

1192


What is the best way of making my program efficient?

961


What is memory leak in c?

1061


How can you return multiple values from a function?

1050