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
Can there be an abstract method without an abstract class?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
How to use Media tracker Class.
What is communist flag?
Can a class extend more than one class?
Explain about static nested classes in java?
Differentiate between a constructor and a method? Can we mark constructors final?
What are the types of arrays in java?
What is meant by structural programming?
How to sort an unsorted array in java?
What is unicode full form?
Explain wrapper classes in java?
What are classloaders?
Difference between object and reference?
What are computer functions?