Heart ♥ in C++ .. ☻

#include<stdio.h>
#include<conio.h>
#include <iostream.h>

void main()
{
clrscr();
int num;
cout<<"Please Enter Number : ";
cin>>num;
cout<<"\n\n";
int g=num*2, x=num/2, v=0, m=num,n=0;

for(int q=0;q<(num/2);q++)
{
for(int u=0;u<x;u++)
printf(" ");
x--;
cout<<char(3);
for(int o=0;o<v;o++)
printf(" ");
v+=2;
cout<<char(3);
for(int l=0;l<m-1;l++)
printf(" ");
m-=2;
cout<<char(3);
for(int a=0;a<n;a++)
printf(" ");
n+=2;
cout<<char(3);
printf("\n");

}

for(int i=0;i<num;i++)
{
int s,j;
for(s=0;s<=i;s++)
{
printf(" ");
}
cout<<char(3);
for(j=0;j<g-1;j++)
{
printf(" ");
}
g-=2;
cout<<char(3);
printf("\n");
if(i==(num-1))
{
for(int f=0;f<(num+1);f++)
printf(" ");
cout<<char(3);
}
}
getch();
}


No comments

Powered by Blogger.