Sunday, February 15, 2009

Exercise no. 3

Exercise # 3:


#include
#include
#include
void menu();
void nextscreen();
void nextscreen2();

void nextscreen()
{
clrscr();
int x,y,z;
for(x=1;x<=77;x++)
{
gotoxy(2+x,1);textcolor(LIGHTBLUE);cprintf("Í");

gotoxy(2+x,21);textcolor(LIGHTBLUE);cprintf("Í");

}
for(y=1;y<=20;y++)
{
gotoxy(3,1+y);textcolor(LIGHTBLUE);cprintf("º");

gotoxy(79,1+y);textcolor(LIGHTBLUE);cprintf("º");

}
gotoxy(3,1);textcolor(RED);cprintf("É");
gotoxy(3,21);textcolor(RED);cprintf("È");
gotoxy(79,1);textcolor(RED);cprintf("»");
gotoxy(79,21);textcolor(RED);cprintf("¼");
}
void menu()
{ clrscr();
nextscreen();
nextscreen2();
int a,b,sum=0,sub=0,mul=0,div=0;

gotoxy(22,5);textcolor(LIGHTCYAN);cprintf("S I M P L E C A L C U L A T I O N ! ! !");
gotoxy(22,7);textcolor(LIGHTRED);cprintf("Enter first number:");
scanf("%d",&a);
gotoxy(22,8);textcolor(YELLOW);cprintf("Enter Second Number:");
scanf("%d",&b);
sum=a+b;
sub=a-b;
mul=a*b;
div=a/b;

gotoxy(25,11);textcolor(LIGHTRED);cprintf("The sum of two number is %d\n",sum);
gotoxy(25,12);textcolor(YELLOW);cprintf("The difference of two number is %d",sub);
gotoxy(25,13);textcolor(LIGHTBLUE);cprintf("The product of two number is %d",mul);
gotoxy(25,14);textcolor(CYAN);cprintf("The qoutient of two number is %d",div);


}
void nextscreen2()

{
clrscr();
int a,b,x,y,z;

for(x=1;x<=77;x++)
{
gotoxy(2+x,1);textcolor(YELLOW);cprintf("Í");
gotoxy(2+x,21);textcolor(YELLOW);cprintf("Í");
}
for(y=1;y<=20;y++){
gotoxy(3,1+y);textcolor(YELLOW);cprintf("º");
gotoxy(79,1+y);textcolor(YELLOW);cprintf("º");
}
gotoxy(3,1);textcolor(RED);cprintf("É");
gotoxy(3,21);textcolor(RED);cprintf("È");
gotoxy(79,1);textcolor(RED);cprintf("»");
gotoxy(79,21);textcolor(RED);cprintf("¼");
for(a=1;a<=49;a++)
{
gotoxy(15+a,4);textcolor(LIGHTBLUE);cprintf("°");
gotoxy(15+a,17);textcolor(LIGHTBLUE);cprintf("°");
}
for(b=1;b<=14;b++)
{
gotoxy(16,3+b);textcolor(LIGHTBLUE);cprintf("°");
gotoxy(65,3+b);textcolor(LIGHTBLUE);cprintf("° ");
}
}
void main()
{
clrscr();

nextscreen();
nextscreen2();
menu();
getch();



}
OUTPUT:

No comments:

Post a Comment