Showing posts with label star. Show all posts
Showing posts with label star. Show all posts

January 29, 2013

Loop Control- Nested for in C++ (OOPs)

/* Program to enter order of the matrix and print stars*/


#include<iostream.h>
#include<conio.h>
main()
{
       int m,n,i,j;
       cout<<"\n Enter order of Matrix m*n";
       cin>>m>>n;
       cout<<"\n";
       for(i=0;i<m;i++)
       {
                       for(j=0;j<n;j++)
                       {
                                       cout<<" *";
                                       }
                       cout<<"\n";
                                       }
       getch();
       }
output of program to display star matrix of any order using nested for loop in C++ (OOPs)