import java.io.*;
import java.lang.*;
class s
{
public void asc(String t)
{
int p,f=0;
for(int i=65;i<=90;i++)
{
f=0;
for(int j=0;j<t.length();j++)
{
p=(int)t.charAt(j);
if((p==i)||(p==i+32))
f+=1;
}
if(f!=0)
System.out.println("FREQUENCY OF "+(char)i+" is "+f+"\t times" );
}
}
}
class Fre
{
public static void main(String args[])throws Exception
{
s ob=new s();
DataInputStream d = new DataInputStream(System.in);
String t;
System.out.println("Enter a String");
t= d.readLine();
ob.asc(t);
}
}
import java.lang.*;
class s
{
public void asc(String t)
{
int p,f=0;
for(int i=65;i<=90;i++)
{
f=0;
for(int j=0;j<t.length();j++)
{
p=(int)t.charAt(j);
if((p==i)||(p==i+32))
f+=1;
}
if(f!=0)
System.out.println("FREQUENCY OF "+(char)i+" is "+f+"\t times" );
}
}
}
class Fre
{
public static void main(String args[])throws Exception
{
s ob=new s();
DataInputStream d = new DataInputStream(System.in);
String t;
System.out.println("Enter a String");
t= d.readLine();
ob.asc(t);
}
}
Comments