Thursday, February 12, 2009
exer 3
#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\nEnd of the program\n\n");
} getch(); }
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment