answersLogoWhite

0

import java.io.*;

class StringContents

{

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the String: ");

String st=in.readLine();

short u=0,l=0,sp=0;

for(short i=0;i<st.length();i++)

{

char ch=st.charAt(i);

if(ch>=65&&ch<91)

u++;

else if(ch>=97&&ch<123)

l++;

else if(ch==' ')

continue;

else

sp++;

}

System.out.println("No. of lower case characters: "+l);

System.out.println("No. of upper case characters: "+u);

System.out.print("No. of special characters: "+sp);

}}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a program to implement the various operations on string such as length of string concatenation reverse of a string copy of a string to another in VB?

what is string


Write a program in java to display a string message using Servlets?

i dont no string for servlate


Write a program convert a string from uppercase to lower case and vice-versa without using string tolower and string toupper commands in TCL?

[ string toupper $str ] or [ string tolower $str ]


Write a java program to count the space from the given line?

.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......


Write a java program to initialize array of string with the days of the week?

final String[] days = new String[] {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


Write the program in Linux to find the reverse of any string?

i am sam


Write a program to find the length of a string in shellscript?

This is an assignment not a question.


How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


Write a c program using string concept enter a sting and replace the new string in to old string and find no of occurrence?

print c co com comp compu


Write a program to eliminate the blanks from string 8085?

public class RemoveSpace{ public static void main(String args[]){ String str = "8085"; Sysytem.out.println(str.trim()); } } Get The Desired OutPut....


How do you write a c program to find the smallest word in a string?

what is if(!(str[i]==32))