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 the data segment that is followed by c?

1029


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1027


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1071


plz let me know how to become a telecom protocol tester. thank you.

2135


regarding pointers concept

1974


Write a program with dynamically allocation of variable.

1064


Disadvantages of C language.

1041


develop algorithms to add polynomials (i) in one variable

2106


What is data types?

1017


What is the sizeof () operator?

1009


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1044


What is build process in c?

1077


Do you know the purpose of 'register' keyword?

963


What is a far pointer in c?

989


Discuss the function of conditional operator, size of operator and comma operator with examples.

1093