hello friends....
TAKE THE FIRST STEP TO KNOWLEDGE FRIENDS BECAUSE KNOWLEDGE IS FREE.
>> /* WRITE MENU DRIVEN C PROGRAM FOR SIMPLE CALCULATOR. */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
char c;
clrscr();
printf("+ addition\n");
printf("- subtraction\n");
printf("* multiplication\n");
printf("/ divisible\n");
printf("% modulo\n");
printf("select any one :\n");
scanf("%c",&c);
printf("enter any two number :\n");
scanf("%d%d",&a,&b);
switch(c)
{
case'+':
printf("addition of two number : %d\n",a+b);
break;
case'-':
printf("subtraction of two number : %d\n",a-b);
break;
case'*':
printf("multiplication of two number : %d",a*b);
break;
case'/':
printf("divisibl of two number : %d\n",a/b);
break;
case'%':
printf("modulo of two number : %d\n",a%b);
break;
default:
printf("please try again \n");
}
getch();
}
/* OUTPUT */
=======================
+ addition
- subtraction
* multiplication
/ divisible\n
% modulo
select any one :
+
enter any two number :
10
20
addition of two number : 30
* * * * * * * * * * * * * *http://www.dnpdeveloper.com
if you have like this blog so share and subscribe, comment for this blog.
if your any question, so comment pleass.
MY INSTAGRAM ID : dnp176
Comments
Post a Comment