Write a program to read a character from user and count the number of occurrences ofthat character Using scala
//Write a program to read a character from user and count the number of occurrences ofthat
//character.
object myObject {
def main(args: Array[String]) {
print("Enter the string");
var s:Char=scala.io.StdIn.readChar();
val string = "Learn programming at IncludeHelp"
val count = string.count(_ == s)
println("This string is '" + string + "'")
println("Count of 'r' in the string :" + count)
}
}