Scanf should return the number of characters taken as inputted..but strangely returning only 1 all the time.
scanf ("%d",&num_test_cases);
for (i=0;i<num_test_cases;i++)
{
level=scanf ("%s",ch);
printf ("\n %s\n",ch);
printf ("%lld\n",level);
}
Sample Input :
4
lrl
rll
r
lllr
Output :
lrl
1
rll
1
r
1
lllr
1
ch.0means nothing was read (unlikely here).EOFmeansstdinisat end-of-file (closed).