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...

how can i get output the following...
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1

and

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

plz plz...

Answer Posted / anas

for(i=n;i>=1;i--)
{
for(c=1;c<=n-i;c++)
{
cout<<" ";
}
for(k=i;k>=1;k--)
{
cout<<k;
}
cout<<"\n";
}
----------------------------------------------
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
//for second.
int n=1;
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
cout<<n<<" ";
n++;
}
cout<<"\n";
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between structure and union in c?

990


What is dynamic variable in c?

1030


What is the purpose of ftell?

1083


how to make a scientific calculater ?

2071


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

2109


What does volatile do?

979


Function calling procedures? and their differences? Why should one go for Call by Reference?

1083


What are c preprocessors?

1186


What is the use of getch ()?

1077


write a program to rearrange the array such way that all even elements should come first and next come odd

2276


Hai what is the different types of versions and their differences

1942


What is file in c preprocessor?

1147


What is a const pointer?

1120


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16777


What is the difference between ‘g’ and “g” in C?

3998