Answers for "number triangle c++"

C++
1

number triangle c++

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
Posted by: Guest on June-05-2021
1

number triangle c++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;	
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(j<=n-i)
			{
				cout<<" ";
			}else{
				cout<<"*";
			}
			
		}cout<<endl;
	}
}
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language