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 most important feature of java? What is an interface?
What are green threads in java?
What are the different approaches to implement a function to generate a random number?
What is a instance variable in java?
What are the problems faced by java programmers who don't use layout managers?
what is the use of bean managed and container managed with example?
What is unicode full form?
What are the differences between processes and threads?
What is :: operator in java?
Why is core java important?
Explain the difference between an object-oriented programming language and object-based programming language?
Can a method be static?
I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com
What is anagram in java?
What is the use of private static?