50) Write a program with a special
member function to input a multi digit long integer number ( max. 9 digit) and
print the following:
1-Total number of Even and Odd digits
2-The Reverse Number
3-Total number of Zero’s present.
public static void main(String args[ ])
Scanner sc = new Scanner (System.in);
System.out.println(">>>>...MENU...<<<<");
System.out.println("Press 1 for number of EVEN and ODD digit");
System.out.println("Press 2 for REVERSE number");
System.out.println("Press 3 for TOTAL number of ZERO in a number");
System.out.println("\nEnter your choice");
System.out.println("Enter a number (not more then 8 digit)");
System.out.println("Number of ODD digits = "+o);
System.out.println("Number of EVEN digits = "+e);
System.out.println("Number NOT EXIST ");
System.out.println("Enter a number (not more then 9 digit)");
System.out.println("REVERSE number = "+r);
System.out.println("Number NOT EXIST ");
System.out.println("Enter a number (not more then 9 digit)");
System.out.println("Total number of ZERO present = "+m);
System.out.println("Number NOT EXIST ");
System.out.println("ENVALID CHOICE");
Output :
No comments:
Post a Comment
if you have any doubts, Please let me know.
Your Truly
Shashank Porwal