My issue
why it’s getting runtime error? i used the given method
My code
#include <stdio.h>
int main() {
int t;
scanf("%d",&t);
for(int i=0;i<t;i++){
int n,k;
scanf("%d %d",&n,&k);
while(n>=k){
n=n-k;
}
printf("%d\n",n);
}
return 0;
}
Learning course: Level up from 1* to 2*
Problem Link: CodeChef: Practical coding for everyone