Write the fork program that was described the calculator div
Write the fork() program that was described the calculator, division and subs traction, multiplication and addition in C language .. i need it to be simple and important to use a fork() function.
Solution
#include<stdio.h>
#include<conio.h>
void main()
{
char a,b,c,d;
clrscr();
printf(\"Enter the values of a and b:\");
scanf(\"%d%d\" ,&a,&b);
printf(\" Enter your choice between 1 to 5 /n\");
scanf(\"%d , &d);
switch(d)
{
case 1;
c=a+b;
printf(\" Addition=%d\", c);
break:
case 2;
c=a-b;
printf(\" Substraction=%d\" , c);
break:
case 3;
c=a*b;
printf(\" Multiplication=%d\", c);
break:
case 4;
c=a/b;
printf(\" Divide=%d\", c);
break:
case 5;
c=a%b;
printf(\" Remainder=%d\",c );
break:
default:
printf(\" Invalid Result\");
break:
}

