//Program to Print Asterics border of size 24(rows) by 79(columns).
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
char array[24][79];
//Loop for Storing '*' at all indexes of array
for (int k=0; k<79; k++)
{
for (int m=0; m<24; m++)
array[m][k] = '*';
}
//Loop for Printing first line
for (int j=0; j<24; j++)
{
cout<<array[0][j]<< " "; //within curly brackets just for proper looking, no use.
}
cout<<endl;
//Loop for Printing verticle lines of border
for (int i=0; i<24; i++)
{
cout<<array[1][0]<<setw(46)<<array[23][1]<<endl; // //within curly brackets no use.
}
//Loop for Printing Last line of Border
for ( j=0; j<24; j++)
{
cout<<array[0][j]<< " "; //within curly brackets just for proper looking, no use.
}
cout<<endl<<endl<<endl<<endl;
return 0;
}
#include <iostream>
#include<iomanip>
#include<windows.h>
using namespace std;
int main()
{
int Speed = 50; //Lesser the value Greater the Speed of printing Asterics
//because it's the time in milliseconds.
char array[24][79];
//Loop for Storing '*' at all indexes of array
for (int k=0; k<79; k++)
{
for (int m=0; m<24; m++)
array[m][k] = '*';
}
//Loop for Printing first line
for (int j=0; j<24; j++)
{
cout<<array[0][j]<< " ";
Sleep(Speed);
}
cout<<endl;
//Loop for Printing verticle lines of border
for (int i=0; i<24; i++)
{
cout<<array[1][0]<<setw(46)<<array[23][1]<<endl;
Sleep(Speed);
}
//Loop for Printing Last line of Border
for ( j=0; j<24; j++)
{
cout<<array[0][j]<< " ";
Sleep(Speed);
}
cout<<endl<<endl<<endl<<endl;
return 0;
}
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
char array[24][79];
//Loop for Storing '*' at all indexes of array
for (int k=0; k<79; k++)
{
for (int m=0; m<24; m++)
array[m][k] = '*';
}
//Loop for Printing first line
for (int j=0; j<24; j++)
{
cout<<array[0][j]<< " "; //within curly brackets just for proper looking, no use.
}
cout<<endl;
//Loop for Printing verticle lines of border
for (int i=0; i<24; i++)
{
cout<<array[1][0]<<setw(46)<<array[23][1]<<endl; // //within curly brackets no use.
}
//Loop for Printing Last line of Border
for ( j=0; j<24; j++)
{
cout<<array[0][j]<< " "; //within curly brackets just for proper looking, no use.
}
cout<<endl<<endl<<endl<<endl;
return 0;
}
A better
& Stylish way of doing the Same Work!
#include <iostream>
#include<iomanip>
#include<windows.h>
using namespace std;
int main()
{
int Speed = 50; //Lesser the value Greater the Speed of printing Asterics
//because it's the time in milliseconds.
char array[24][79];
//Loop for Storing '*' at all indexes of array
for (int k=0; k<79; k++)
{
for (int m=0; m<24; m++)
array[m][k] = '*';
}
//Loop for Printing first line
for (int j=0; j<24; j++)
{
cout<<array[0][j]<< " ";
Sleep(Speed);
}
cout<<endl;
//Loop for Printing verticle lines of border
for (int i=0; i<24; i++)
{
cout<<array[1][0]<<setw(46)<<array[23][1]<<endl;
Sleep(Speed);
}
//Loop for Printing Last line of Border
for ( j=0; j<24; j++)
{
cout<<array[0][j]<< " ";
Sleep(Speed);
}
cout<<endl<<endl<<endl<<endl;
return 0;
}
No comments:
Post a Comment