Write a program in C++ using nested…for loop - WAY2IT

Latest Post :

Home Top Ad

Write a program in C++ using nested…for loop




Code :-

#include<iostream.h>
#include<conio.h>
//loops
//for loop
void main()
{
int i,j;
cout<<"Number Triangle \n";
for(i=1;i<=7;i++)
{
for(j=1;j<=i;j++)
{
cout<<j;
}
cout<<"\n";
}
}



Output :-