Saturday, July 9, 2011
Calculate Length of String
public class StringDemolength
{
static int length(String s)
{
int i,count=0;
for(i=0;i
{
count++;
}
return count;
}
public static void main(String args[])
{
String s="India is a good country";
int count=length(s);
System.out.println(count);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment