How to write a java program to accept a number as input from user and check whether it is a special number or not.
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 …