Loading...
Design a class to overload a method Number( ) as follows: (i) void Number (int num , int d) - To count and display the frequency of a digit in a number. Example: num = 2565685 d = 5 Frequency of digit 5 = 3 (ii) void Number (int n1) - To find and display the sum of even digits of a number. Example: n1 = 29865 Sum of even digits = 16 Write a main method to create an object and invoke the above methods.
Define a class to overload the function print as follows: void print() to print the following format 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 void print(int n) To check whether the number is a lead number. A lead number is the one whose sum of even digits are equal to sum of odd digits. e.g. 3669 odd digits sum = 3 + 9 = 12 even digits sum = 6 + 6 = 12 3669 is a lead number.
© 2026 PadhAiPro. This question is provided for educational purposes.