Saturday, 31 January 2015

C Program To Calculator without Switch

Calculator without Switch

//Calculator without Switch

#include<stdio.h>
#include<conio.h>
void main()
{
 float a,b,num1,num2,c,d;
 clrscr();
 printf("Enter first value");
 scanf("%f",&num1);
 printf("Enter second value");
 scanf("%f",&num2);
   a=num1+num2;
   b=num1*num2;
   c=num1-num2;
   d=num1/num2;

 printf("Addition of first and second value is %f\n",a);
 printf("Multiplication of first and second value is %f\n",b);
 printf("Subtraction of first and second value is %f\n",c);
 printf("Division of first and second value is %f\n",d);

getch();
}

No comments:

Post a Comment