Write a program  that displays a triangle of integers, according to an integer entered by the user. Example   N=4

1

22

333

4444   

******** In Algorithm ********

Algorithm Variables i,j,N : integers Begin write("Enter an integer : ") read(N) for i from 1 to N for j from 1 to i write (i) next next End Result ==> Enter an integer : 5 1 22 333 4444 55555

******** In C ********

#include<stdio.h> int main() { int i,j,N; printf("Enter an integer :"); scanf("%d",&N); for(i=1; i<= N;i++){ for(j=1; j<= i;j++) printf("%d",i); printf("\n"); } return 0; }


******** In C++ ********

#include <iostream> using namespace std; int main() { int i,j,N; cout<<"Enter an integer :"; cin>>N ; for(i=1;i<=N;i++){ for(j=1;j<= i;j++) { cout<<i; } cout<<endl; } return 0; }