Computer Science, asked by David2018, 1 year ago

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
nitish8089: language
nitish8089: sorry bro! by mistake i click on report the question
nitish8089: sorry

Answers

Answered by manojnarayanpur
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;
}
}
}


David2018: plz send using for loop
Similar questions