My issue
include <stdio.h>
int main(void) {
int X; int Y; int H;
scanf(“%d %d %d”, &X, &Y, &H);
printf("%d", X + (H-X)*Y);
return 0;
}
Inputs taken are:- X = 1, Y = 10, H = 100 (custom inputs)
My code for this question. Yet, CodeChef says this is the wrong answer. Can anyone tell me where it’s wrong?
My code
#include <stdio.h>
int main(void) {
int X; int Y; int H;
scanf("%d %d %d", &X, &Y, &H);
printf("%d", X + (H-X)*Y);
return 0;
}
Learning course: CSEIPFOIA: Programming and Problem Solving
Problem Link: Problem - 4 Practice Problem in CSEIPFOIA: Programming and Problem Solving - CodeChef