Friday, June 30, 2017

java

WAP  ACCEPT A String and count char with using method?


int count=0;
Scanner obj = new Scanner(System.in);
String s1=obj.nextLine();
for(char c:s1)
{
count++;
}
System.out.print(count);

No comments:

Post a Comment