What will be the output of the following program?
public class CountoccurrencesOfCharacter
{
string inputstring = "LoveYourself"
char searchChar = 'a'
int count = 0;
for(int i=0; iinputstring.length(); i++)
{
if(inputstring .charAt(i) == searchChar)
{
count++
}
}
system.out.println("Character" + searchChar+"appears in the inputstring"+count+"times");
}
}

Posted on by