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

What does 4d mean in c?

1453


Tell me with an example the self-referential structure?

944


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

1731


What are the salient features of c languages?

1048


What are local variables c?

963


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1900


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

2207


When should you not use a type cast?

1072


Which of these functions is safer to use : fgets(), gets()? Why?

1047


Explain what is the difference between a string and an array?

1104


Which is best linux os?

974


which type of aspect you want from the student.

2118


What is context in c?

886


write an algorithm to display a square matrix.

2643


Why we write conio h in c?

967