Write a program to check whether a no. Entered is a lucky number or not??? | Sololearn: Learn to code for FREE!

+1

Write a program to check whether a no. Entered is a lucky number or not???

7/31/2017 6:20:15 PM

Aniket Tiwari

1 Answer

New Answer

+2

import java.util.*; public class Program { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int x = scn.nextInt(); if(x == 3){System.out.println(x + " Is my lucky number"); } else {System.out.println(x);} } }