import java.util.Scanner;
class Special_Number
{
public static void main()
{
Scanner sc = new Scanner (System.in);
System.out.println(“Enter any no.”);
int n = sc.nextInt ();
int f = 0;
int r;
while (n>0)
{
int a= n;
r=n%10;
a=a/10;
while (a>=1)
{
if (r==a%10)
{f=1;
System.out.println(“not a special no”);
System.exit(0);
}
a=a/10;
}
n=n/10;
}
if (f ==0)
System.out.println(“special no”);
}
}
In this post I have shared a java program to accept a number from user as input and check whether its a special number or not.A number is special number if it contains digits in such way that no digit of the number is repeated.If the digits of the number are repeated then the number is not a special number.
THANK YOU FOR VISITING OUR BLOG.For more related posts and anime,programing,gaming post please regularly check our blog.
THANK YOU!!!!!!!!!!!
Making money as a coder in 2025 is not much of a big or tough…
Lloyds Technology Centre, A tech and data company located in Hyderabad, India. They are part of…
How to Increase Height at Any Age Rise Above: How to Increase Height at Any…
In the fast-paced digital world, we often forget the timeless beauty that nature offers. Today,…
Top 10 Deadliest Kicks in Martial Arts: Master the Art of Knockouts Martial arts is…
How to Optimize Battery Life of Your Smartphone: Tips and Tricks for Prolonging Battery Health…