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 / sahil and dipanshu

#include<stdio.h>
#include<iostream.h>

int main()
{
int i,j,k,num;
num=5;
for(i=1;i<=num;i++)
{
for(j=1;j<num-i;j++)
{
cout<<" ";
}
for(k=1;k<=i;k++)
{
cout<<k;
}
for(k=i;k>1;k--)
{
cout<<k-1;
}
cout<<endl;
}
return 0;
}

Is This Answer Correct ?    21 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we increase size of array in c?

957


what will be the output for the following main() { printf("hi" "hello"); }

10961


What are the different types of C instructions?

1295


How is pointer initialized in c?

1010


What is return in c programming?

958


How does normalization of huge pointer works?

1159


What is volatile keyword in c?

1027


What is the use of in c?

1013


difference between native and cross compilers

2110


What is a spanning Tree?

1565


What is meant by inheritance?

1071


Why c is procedure oriented?

1056


What is a class c rental property?

1084


I heard that you have to include stdio.h before calling printf. Why?

1050


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1809