My issue
In this problem, I want the user to dynamically input the no of test cases, and the distance between the Chef’s home and office. However, I am not getting the chance to enter the no of test cases or the distance in each test case. How should I tackle this problem
My code
#include<stdio.h>
int main()
{
int t, d, D;
printf("Please enter the no. of test cases you dezire: ");
scanf("%d", &t);
printf("\n");
for(int i=0; i<t; i++)
{
printf("Please enter the no of Kilometeres that the chef walks: ");
scanf("%d", &d);
printf("\n");
D = 10*d;
printf("Every week, the Chef walks a total of = %d km", D);
printf("\n");
}
return 0;
}
Learning course: Basic Math using C
Problem Link: CodeChef: Practical coding for everyone