/*
Write a program to draw a SWASTIK on center of the screen with blink effect.
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0;
clrscr();
textcolor(RED+BLINK);
for(i=8;i<25;i++)
{
gotoxy(20,i);
cprintf("*");
gotoxy(40,i);
cprintf("*");
if(i<23)
{
gotoxy(20+2,i);
cprintf("*");
gotoxy(40+2,i+2);
cprintf("*");
}
}
for(i=23;i<=40;i++)
{
if(i<39)
{
gotoxy(40,i);
cprintf("*");
gotoxy(60,i+2);
cprintf("*");
}
gotoxy(40+2,i);
cprintf("*");
gotoxy(60+2,i);
cprintf("*");
}
for(i=20;i<42;i++)
{
gotoxy(i,25);
cprintf("*");
gotoxy(i,40);
cprintf("*");
if(i<40)
{
gotoxy(i+2,25-2);
cprintf("*");
gotoxy(i,40-2);
cprintf("*");
}
}
for(i=40;i<62;i++)
{
if(i<60)
{
gotoxy(i+2,10);
cprintf("*");
gotoxy(i,25);
cprintf("*");
}
gotoxy(i,10-2);
cprintf("*");
gotoxy(i,25-2);
cprintf("*");
}
getch();
}
Output :
Write a program to draw a SWASTIK on center of the screen with blink effect.
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0;
clrscr();
textcolor(RED+BLINK);
for(i=8;i<25;i++)
{
gotoxy(20,i);
cprintf("*");
gotoxy(40,i);
cprintf("*");
if(i<23)
{
gotoxy(20+2,i);
cprintf("*");
gotoxy(40+2,i+2);
cprintf("*");
}
}
for(i=23;i<=40;i++)
{
if(i<39)
{
gotoxy(40,i);
cprintf("*");
gotoxy(60,i+2);
cprintf("*");
}
gotoxy(40+2,i);
cprintf("*");
gotoxy(60+2,i);
cprintf("*");
}
for(i=20;i<42;i++)
{
gotoxy(i,25);
cprintf("*");
gotoxy(i,40);
cprintf("*");
if(i<40)
{
gotoxy(i+2,25-2);
cprintf("*");
gotoxy(i,40-2);
cprintf("*");
}
}
for(i=40;i<62;i++)
{
if(i<60)
{
gotoxy(i+2,10);
cprintf("*");
gotoxy(i,25);
cprintf("*");
}
gotoxy(i,10-2);
cprintf("*");
gotoxy(i,25-2);
cprintf("*");
}
getch();
}
Output :
0 comments:
Post a Comment