Java Tutor...
Java program that displays the number of characters, lines and words in a text file
while((c=isr.read())!=-1)
{
chars++;
if(c==’\n’)
lines++;
if(c==’\t’ || c==’ ‘ || c==’\n’)
++words;
if(chars!=0)
++chars;
}
‹
›
Home
View web version