This will help get you started. Replace the //... lines with your code to calculate and print difference, product, quotient, and average.
Also read the documentation on the functions scanf and printf to better understand them.
http://www.cplusplus.com/reference/cstdio/scanf/http://www.cplusplus.com/reference/cstdio/printf/Code
#include <stdio.h>
int main(){
double a,b;
double sum;
double difference;
double product;
double quotient;
double average;
printf("Please enter a number for a : ");
scanf("%lf", &a);
printf("Please enter a number for b : ");
scanf("%lf", &b);
printf("a is %.2lf.\n",a);
printf("b is %.2lf.\n",b);
//set sum
sum=a+b;
//print sum
printf("sum is %.2lf.\n",sum);
//set difference
//...
//print difference
//...
//set product
//...
//print product
//...
//set quotient
//...
//print quotient
//...
//set average
//...
//print average
//...
/*this is just here to prevent the console window from closing right away after the program runs */
scanf("%f", &a);
return 0;
}
This post was edited by labatymo on Sep 23 2014 07:26am