Nesting of For Loop in C/C++

Nesting of For Loop in C/C++


This program is "Nesting of For Loop" and it prints out "*" in a parallel way in C/C++. The program is given below:


#include<iostream>
using namespace std;
int main()
{
int i, j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
cout << "*";
}
cout << "\n";
}
}

Comments

Popular posts from this blog

Classes in OOP (Object Oriented Programming)

A small airline has just purchased a computer for its new automated reservations system. You’ve been asked to program the new system. You are to write a program to assign seats on each flight of the air line’s only plane (capacity: 10 seats).