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

Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2238


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

1415


What is the purpose of the preprocessor directive error?

1318


main() { printf("hello"); fork(); }

1251


What is static memory allocation?

1251


how to execute a program using if else condition and the output should enter number and the number is odd only...

2377


How do you print only part of a string?

1073


Explain how can I avoid the abort, retry, fail messages?

1107


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2310


What is c language and why we use it?

1127


to find the closest pair

2375


why return type of main is not necessary in linux

2155


What does typeof return in c?

1163


What is a volatile keyword in c?

1219


Is c pass by value or reference?

1112