Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Tuesday, January 05, 2016

C++ logical questions | C++ logical programming questions | logic building programs in c++ | programming logical thinking | logical questions in C

C++ logical questions | C++ logical programming questions | logic building programs in c++ | programming logical thinking | logical questions in C

Source Code

#include <iostream>
#include <unistd.h>
using namespace std;

/*Uzair*/

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 By LEP                    **"<<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";
} 
}

Output of the Program  

logic building programs in c++
Share:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List