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.
Write a menu driven program to perform the following operations as per user’s choice: (i) To print the value of c=a²+2ab, where a varies from 1.0 to 20.0 with increment of 2.0 and b=3.0 is a constant. (ii) To display the following pattern using for loop: A AB ABC ABCD ABCDE Display proper message for an invalid choice.
© 2026 PadhAiPro. This question is provided for educational purposes.