Tuesday, February 10, 2009

Exer 3 CS 121

Photobucket

Photobucket


#include
#include


void main(){
clrscr();
int choice,a,b,n,y,sum=0,sub=0,mul=0,div=0;

printf("\t\t\t >>>>> <<<<>>>> <<<<<"); printf("\t\t\t\t\t\t\t OF THE"); printf("\n\t\t <<<<<>>>>>");
printf("\n\nSelect operation you like to Try!");
printf("\n\n\n\t[A] for ADDITION");
printf("\n\t[B] for SUBTRACTION");
printf("\n\t[C] for MULTIPLICATION");
printf("\n\t[D] for DIVISION");
printf("\n\t[E] for EXIT");
printf("\n\nPlease enter the CAPITAL letter of the operation you choose:");
scanf("%s",&choice);
switch(choice)
{
case 'A':
printf("\n\nEnter your 1ST number pls: ");
scanf("%d",&a);
printf("Then enter the 2ND number pls: ");
scanf("%d",&b);
sum=a+b;
printf("\n_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-");
printf("\n\nSummation of two number is: -- %d --",sum);
break;

case 'B':
printf("\n\nEnter your 1ST number pls: ");
scanf("%d",&a);
printf("Then enter the 2ND number pls: ");
scanf("%d",&b);
sub=a-b;
printf("\n_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-");
printf("\n\nDifference of two number is: -- %d --",sub);
break;

case 'C':
printf("\n\nEnter your 1ST number pls: ");
scanf("%d",&a);
printf("Then enter the 2ND number pls: ");
scanf("%d",&b);
mul=a*b;
printf("\n_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-");
printf("\n\nProduction of two number is: -- %d --",mul);
break;

case 'D':
printf("\n\nEnter your 1ST number pls: ");
scanf("%d",&a);
printf("Then enter the 2ND number pls: ");
scanf("%d",&b);
div=a/b;
printf("\n_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-");
printf("\n\nDivision of two number is: -- %d --",div);
break;

case'E':
printf("\n\n-@`~_.,End of the program,._~`@-\n\n>_<>_<"); printf("\n\n\t\t\t\t\t Programmed by: SHERLUCK L. MERCADO"); printf("\n\t\t\t\t\t\tCS121(5820) / 12:30-2:30 / H1I"); } getch(); }

No comments:

Post a Comment