my code is below
how to avoid the blank line printed before the required output?
the question is to print the batsman with maximum runs.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,runs,maxRuns=0;
char bat[100],maxBat[100];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%[^,],%d",&bat,&runs);
if(runs>maxRuns){
maxRuns=runs;
strcpy(maxBat,bat);
}
}
printf("%s",maxBat);
}
the output i'm getting is
