Thursday, February 5, 2009

Exer7


#include
#include
#include
#include
#include

void swtch();
void frme();
void ext();
void loop();
void loop1();
void main(){



clrscr();
frme();
loop1();
swtch();
getche();

}

void frme()
{

int x,y;
for(x=1;x<=77;x++){ gotoxy(1,1);textcolor(BLUE);cprintf("É"); gotoxy(1+x,1);textcolor(BLUE);cprintf("Í"); gotoxy(1+x,25);textcolor(BLUE);cprintf("Í"); gotoxy(1,25);textcolor(BLUE);cprintf("È"); } for(y=1;y<=23;y++){ gotoxy(1,1+y);textcolor(BLUE);cprintf("º"); gotoxy(78,1);textcolor(BLUE);cprintf("»"); gotoxy(78,1+y);textcolor(BLUE);cprintf("º"); gotoxy(78,25);textcolor(BLUE);cprintf("¼"); } for(x=5;x<=72;x++){ gotoxy(5,3);textcolor(BLUE);cprintf("É"); gotoxy(1+x,3);textcolor(BLUE);cprintf("Í"); gotoxy(1+x,22);textcolor(BLUE);cprintf("Í"); gotoxy(5,22);textcolor(BLUE);cprintf("È"); } for(y=1;y<=18;y++){ gotoxy(5,3+y);textcolor(BLUE);cprintf("º"); gotoxy(73,3);textcolor(BLUE);cprintf("»"); gotoxy(73,3+y);textcolor(BLUE);cprintf("º"); gotoxy(73,22);textcolor(BLUE);cprintf("¼"); } } void swtch() { clrscr(); frme(); _setcursortype(_NOCURSOR); int A,B,C,D,choice; char c[]={" W E L C O M E "}; for(int x=0;x
{
gotoxy(25+x,6);
textcolor(WHITE);
cprintf("%c",c[x]);
delay(40);
}
gotoxy(32,8);textcolor(WHITE);cprintf("[A]. ADDITION");
gotoxy(32,10);textcolor(WHITE);cprintf("[B]. SUBTRACTION");
gotoxy(32,12);textcolor(WHITE);cprintf("[C]. MULTIPLICATION");
gotoxy(32,14);textcolor(WHITE);cprintf("[D]. DIVISION");
gotoxy(32,16);textcolor(WHITE);cprintf("[E]. E X I T");
gotoxy(32,18);textcolor(WHITE);cprintf("Enter choice:");
scanf("%s",&choice);
switch(choice){
case 'A':
clrscr();
frme();
loop();
_setcursortype(_NOCURSOR);
int num1,num2,ans;
gotoxy(32,6);textcolor(WHITE+BLINK);cprintf("A D D I T I O N");
gotoxy(32,9);textcolor(BLUE);cprintf("Enter num1:");
scanf("%d",&num1);
gotoxy(32,11);textcolor(BLUE);cprintf("Enter num2:");
scanf("%d",&num2);
ans=num1+num2;
gotoxy(32,13);textcolor(WHITE);cprintf("Sum is: %d",ans);
getche();
clrscr();
frme();loop();
swtch();
break;


case 'B':
clrscr();
frme();loop();
_setcursortype(_NOCURSOR);
int e,s,diff;
gotoxy(30,6);textcolor(WHITE+BLINK);cprintf("S U B T R A C T I O N");
gotoxy(32,9);textcolor(BLUE);cprintf("Enter num1:");
scanf("%d",&e);
gotoxy(32,11);textcolor(BLUE);cprintf("Enter num2:");
scanf("%d",&s);
diff=e-s;
gotoxy(32,13);textcolor(WHITE);cprintf("Difference is: %d",diff);
getche();
clrscr();
frme(); loop();
swtch();
break;

case 'C':
clrscr();
frme();loop();
_setcursortype(_NOCURSOR);
int l,k,prod;
gotoxy(30,6);textcolor(WHITE+BLINK);cprintf("M U L T I P L I C A T I O N");
gotoxy(32,9);textcolor(BLUE);cprintf("Enter num1:");
scanf("%d",&l);
gotoxy(32,11);textcolor(BLUE);cprintf("Enter num2:");
scanf("%d",&k);
prod=l*k;
gotoxy(32,13);textcolor(WHITE);cprintf("Product is: %d",prod);
getche();
clrscr();
loop();
frme();
swtch();
break;

case 'D':
clrscr();
frme();loop();
_setcursortype(_NOCURSOR);
int o,u,quo;
gotoxy(34,6);textcolor(WHITE+BLINK);cprintf("D I V I S I O N");
gotoxy(32,9);textcolor(BLUE);cprintf("Enter num1:");
scanf("%d",&o);
gotoxy(32,11);textcolor(BLUE);cprintf("Enter num2:");
scanf("%d",&u);
quo=o/u;
gotoxy(32,13);textcolor(WHITE);cprintf("Quotient is: %d",quo);
getche();
clrscr();
frme(); loop();
swtch();
break;

case 'E':
clrscr();frme(); _setcursortype(_NOCURSOR);
loop1();
ext();
exit(0);
getche();
break;


default:
clrscr();
frme(); loop();
_setcursortype(_NOCURSOR);
char c[]={" I N V A L I D I N P U T ! ! "};
for(int x=0;x
{
gotoxy(24+x,12);
textcolor(WHITE);
cprintf("%c",c[x]);
delay(40);
}
}
clrscr();
frme();loop();
swtch();
}
void ext()
{
clrscr();
_setcursortype(_NOCURSOR);
int l,m;
for(l=1;l<=65;l++) { gotoxy(6+l,7);printf("ì"); gotoxy(72-l,18);printf("ì"); delay(20); } _setcursortype(_SOLIDCURSOR); char c[]={" Logging out, Thankyou!!! "}; for(int x=0;x
{
gotoxy(25+x,11);
textcolor(9);
cprintf("%c",c[x]);
normvideo();
delay(40);
}
{

}
}
void loop()
{
_setcursortype(_NOCURSOR);
for(int e=0;e<=25;e++){ gotoxy(5+e,23);textcolor(YELLOW);cprintf("¯"); } for(int i=0;(i<=25*4);i++) { gotoxy(5+(i/4),23);textcolor(RED);cprintf("¯"); gotoxy(5,24);textcolor(6);cprintf("%d%",i); delay(10); } for(int o=0;o<=25;o++) { gotoxy(5+o,23);textcolor(YELLOW);cprintf("¯"); } } void loop1() { _setcursortype(_NOCURSOR); for(int e=0;e<=25;e++){ gotoxy(5+e,23);textcolor(YELLOW);cprintf("¯"); } gotoxy(8,24);textcolor(WHITE+BLINK);cprintf("LOADING......"); for(int i=0;(i<=25*4);i++) { gotoxy(5+(i/4),23);textcolor(RED);cprintf("¯"); gotoxy(5,24);textcolor(6);cprintf("%d%",i); delay(15); } for(int o=0;o<=25;o++) { gotoxy(5+o,23);textcolor(YELLOW);cprintf("¯"); } }

No comments: