Sunday, October 20, 2019

Pattern printing 1

Expected pattern

 

* * * *
* * * *
* * * *
* * * *
* * * *

Program

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

Video explanation

 

 

No comments:

Post a Comment