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

Program to print 1
1 2
1 2 3
1 2 3 4 like that

Answer Posted / vivek

#include<iostream>
using namespace std;
int main()
{
int i,j,n,k;
cout<<"provide the no. of row";
cin>>n;
for(i=1; i<=n; i++)
{
k=n-i;
while(k>0)
{
cout<<" ";
k--;
}
for(j=1; j<i; j++)
cout<<" "<<j<< " ";
cout<<"\n";
}
return(0);
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can there be an abstract method without an abstract class?

958


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

1241


How to use Media tracker Class.

1133


What is communist flag?

1020


Can a class extend more than one class?

1126


Explain about static nested classes in java?

1072


Differentiate between a constructor and a method? Can we mark constructors final?

1201


What are the types of arrays in java?

1090


What is meant by structural programming?

1022


How to sort an unsorted array in java?

1137


What is unicode full form?

983


Explain wrapper classes in java?

1001


What are classloaders?

1022


Difference between object and reference?

1179


What are computer functions?

948