wap to input an integer and display the frequency of each digit in that integer. plz solve and send the full prog...very argent for computer project....
nitish8089:
frequency means
Answers
Answered by
1
import java.util.*;
class Display
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter an integer");
int n=sc.nextInt();
int f=0;
while(n>0)
{
int d=n÷10;
for(int i=1;i<=9;i++)
{
if(i==d)
f++;
System.out.println("frequency of "+i"=+"f);
else
continue;
}
n=n/10;
}
}
}
Similar questions