Sunday, February 12, 2017

Write a Program in Java to input a number and check whether it is a Unique Number or not.

Note: A Unique number is a positive integer (without leading zeros) with no duplicate digits. For example 7, 135, 214 are all unique numbers whereas 33, 3121, 300 are not. import static java.lang.System.out; import java.io.BufferedReader; import java.io.InputStreamReader; class Unique { public static void main(String...alt)throws Exception { int flag=0; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); out.print("Enter a Number : "); String n=br.readLine(); label: for(int i=0;i

Share this

0 Comment to "Write a Program in Java to input a number and check whether it is a Unique Number or not."

Post a Comment