Skip to main content

Posts

Showing posts with the label unique number

UNIQUE NUMBER

PROGRAM : UNIQUE NUMBER A Number is Said to be unique if 1- it do not start with 0. 2- it do not have any repeating digit. for example: 0112 is not a unique no.                         1234 is a unique no.  SYNTAX: import java.io.*; class unique_num {     public static void main(String args[])throws IOException     {         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));         String s;int val=0;         System.out.println("Enter a Number");         s=br.readLine();         if(s.charAt(0)=='0')         System.out.println("**** The Number is Not a Unique Number ****");         else         {             for(int i=0;i<s.length();i++)       ...