Write a program that will count number of character in a sentence entered by the user.
Answers
Answered by
0
Answer:
Take a String variable let's say S and then take an integer variable i and in the variable i store the length of the variable S.
Code:
String S="HI I AM A BOY";
int i=S.length();//stores the length of S
System.out.println(i);
Output:
13
Similar questions