Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Calculator
SUBMITTED BY:
Guest
DATE:
May 21, 2013, 1:33 p.m.
FORMAT:
Text only
SIZE:
510 Bytes
Raw
Download
Tweet
HITS:
6371
Go to comments
Report
#include <stdio.h>
int main()
{
float num1, num2;
char operation;
while (1) {
scanf("%f%c%f", &num1, &operation, &num2);
if (operation == '+')
printf("%f\n", num1+num2);
if (operation == '-')
printf("%f\n", num1-num2);
if (operation == '*')
printf("%f\n", num1*num2);
if (operation == '/')
printf("%f\n", num1/num2);
}
return 0;
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus