Saturday 19 December 2015

Whole A,B,C using stars (starrics) using nested loops in C++

Sample of Z:

#include <iostream>

using namespace std;

int main()
{
    int size;
    cout<<"Enter the size of shape."<<endl;
    cin>>size;
    for(int i=1 ; i<=size; i++)
    {
        for(int j=1 ; j<=size ; j++)
        {
            if(i==size || i==1 || i+j==size+1)
            {
                cout<<"*";
            }
            else{
                cout<<" ";
            }
        }
        cout<<endl;
    }
    return 0;
}




To download the Visual studio or Code blocks file Click Here after clicking on the download link wait for 5 seconds and click on Skip ad button your download will start.

No comments:

Post a Comment