I am writing a program to a class. It is pretty self explanatory on what is supposed to happen but the math is coming up completely wrong. Any help?
Code:
#include<stdio.h>
#define POUNDS 16 // 1lbs = 16 oz
#define KILOGRAMS 1000 // 1kilogram = 1000 grams
#define OUNCE .028 // ounce/kilo
#define GRAM 28.35 // ounce/gram
int main(void)
{
int lbs, oz;
float kg, g;
printf("Enter pounds\n");
scanf("%d", &lbs);
printf("Enter ounces\n");
scanf("%d",&oz);
printf("The weight converted to kilograms is %d\n ",((lbs * POUNDS)+ oz)* OUNCE);
printf("The weight converted to grams is %d\n ",((lbs * POUNDS)+ oz)* GRAM);
return 0;