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
What is the abstraction?
Is int primitive data type?
Where are the card layouts used?
What is mutable object and immutable object?
What is the difference between compiler and jvm?
when to use ArrayList and when to use HashMap in webApplication.
What are different types of states exist for a thread?
How do you implement singleton class?
What are bind parameters?
Why does it take so much time to access an applet having swing components the first time?
Can we make constructors static?
What is the purpose of declaring a variable as final?
What is return code?
What are the data types supported by java?
What is primitive data type in java?