Loading...
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.
Define a class to overload the method perform as follows: double perform (double r, double h) to calculate and return the value of Curved surface area of cone CSA = πrl l = √(r² + h²) void perform (int r, int c) Use NESTED FOR LOOP to generate the following format r = 4, c = 5 output – 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 void perform (int m, int n, char ch) to print the quotient of the division of m and n if ch is Q else print the remainder of the division of m and n if ch is R
Define a class to overload the method print( ) as follows: void print ( ) – To print the given format using nested loops. @#@#@ @#@#@ @#@#@ @#@#@ double print(double a, double b) – To display the sum of numbers between a and b with difference of 0.5. e.g. if a = 1.0, b = 4.0 output is: 1.0 + 1.5 + 2.0 + 2.5 + ……………. + 4.0 int print(char ch1, char ch2) – compare the two characters and return the ASCII code of the largest character.
Define a class to overload the method format as follows: void format (): To print the following pattern using Nested for loops only: 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5 int format (String s): To calculate and return the sum of ASCII codes of each character of the String. Example: CAB Output: 67 + 65 + 66 198 void format (int n): To calculate and display the sum of natural numbers up to n given by the formula. n(n + 1) / 2
© 2026 PadhAiPro. This question is provided for educational purposes.