This is a simple Cpp Program which prints out a Right angled triangle with respect to the input given.
Download Code PROGRAM :
Download Code OUTPUT :
Right angled triangle pattern program |
#include <iostream> using namespace std; int main() { int i, j, n,k; cout << "Enter number of lines[height of triangle] : \t"; cin >> n; for(i=1; i<=n; i++) { for(j=i; j<n; j++) { cout << " "; } for(k=1; k<(i*2); k++) { cout << k++; } cout << "\n"; } return 0; }
Cpp Program - Right angled triangle pattern |