Computer Science, asked by mohantahemalata, 1 year ago

How to find length of a string without using . length () function?
Plz answer in Blue Java.

Answers

Answered by siddhartharao77
6
import java.util.*;
class Brainly
{
public static void main(String[] args)
{
String word;
int i=0;
System.out.println("Enter a word:");
Scanner demo = new Scanner(System.in);
word=demo.nextLine();
for(char ch:word.toCharArray())
{
i++;
}
System.out.println("The number is:" +i);
}
}


Hope this helps!
Attachments:

siddhartharao77: Mark as brainliest.
manasvini: kk
manasvini: naku pooti aa
siddhartharao77: Ayooo..Ala kaadu
Anonymous: bore answer
manasvini: cool brother
Anonymous: cool
Anonymous: nice
Anonymous: Nice answer bro ^^
Similar questions