I have a very simple program. I need to write a program that reads two integers (wins, losses). Call the two functions by passing the two numbers. Display the winning and losing percents. I wrote a code, but it didn't calculate and display the percentage. Need some help.
#include<stdio.h>
double Win (double winns);
double Loss (double losses);
int main() {
int num1, num2, total;
double winns, losses, sum1, sum2;
printf("Enter the number of wins: ");
scanf("%d", &num1);
printf("Enter the number of losses: ");
scanf("%d", &num2);
total = num1 + num2;
winns = (num1/total)/100;
losses = (num2/total)/100;
sum1 = Win(winns);
sum2 = Loss(losses);
printf("The team's winning percent for the years was: %.2f\n", sum1);
printf("The team's losig percent for the years was: %.2f\n", sum2);
return 0;
}
double Win (double winns){
return (winns);
}
double Loss (double losses){
return (losses);
}