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

How to perform bubble sort in java?

994


Is call by reference possible in java?

962


What is a condition in java?

1006


In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?

1052


What is variable and example?

965


Can an interface have a constructor?

971


What is difference between wait and notify in java?

1134


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

1024


What is lexicographically smallest string?

1065


Can we have a try block without catch block?

983


what is encapsulation in java? Explain

1107


What happens when heap memory is full?

985


What are the actions that can occur when a thread enters blocked state?

1056


How can you avoid serialization in child class if the base class is implementing the serializable interface?

1082


What do you mean by local variable and instance variable?

949