wait a minute!
akulkarni: did you try to compile and run it? did you run it several times with diferent strings?
Try inputing "naan".
What happens?
Bulls: 0;
Cows: 3;
What happens with "nana"?
Bulls: 2,
Cows: 1.
See what's going on? The problem is that when you modifiy s1c you also modify s2c, but at the same index!!!
My advice, you either don't modify s1c (the one on line 29, of course) and just delete this line. The other possibility is also modifying s2c but on j index as in s2c[j]='#';
, that is line 30.
Take care