This is the cool and logic building C++ program for beginners. The purpose of this C++ code is to understand the different programming terms in different ways. The program will generate an arrow at the end of executing.
Source Code
#include <iostream>
#include <unistd.h>
using namespace std;
void welcomeScrean(void);
void sleep();
void draw();
int main()
{
system ("color F0");
welcomeScrean();
draw();
return 0;
}
void welcomeScrean(void){
cout<<"\a"
<<"\t*******************************************************"<<endl
<<"\t*******************************************************"<<endl
<<"\t** Welcome To **"<<endl
<<"\t** Draw By * **"<<endl
<<"\t** Program **"<<endl
<<"\t*******************************************************"<<endl
<<"\t*******************************************************"<<endl
<<endl
<<endl;
sleep();
}
void sleep(){
sleep(1);
for (int i=0 ; i<3;i++)
{
if (i==0)
{
cout<<"\tJust a min ";
}//END IF i
cout<<"\a.";
sleep(2);
}//
}
void draw(){
int size,i,j,k,k1,p;
cout<<"\n\n\tEnter A No : ";
cin>>size;
cout<<"\n\n\t";
for (i=0;i<size;i++)
{
k = size-i;
for (j=0;j<k;j++)
{
cout<<" ";
}
for (j=k;j<size;j++)
{
cout<<"*";
}
cout<<"I";
for (j=k;j<size;j++)
{
cout<<"*";
}
cout<<"\n\t";
}
k = size / 2;
k1 = k / 2;
p = size-k1;
for (i=0;i<k;i++)
{
for(j=0;j<p;j++)
{
cout<<" ";
}
for(j=0;j<k1;j++)
{
cout<<"*";
}
cout<<"I";
for(j=0;j<k1;j++)
{
cout<<"*";
}
cout<<"\n\t";
}
}
0 comments:
Post a Comment