Computer Science, asked by dikshajadhav51, 4 months ago

I will mark brainliest to those who give me the correct answer also i will follow him
Q1) Design a class to overload function compare
Void compare(int a ,int b,char ch) –
Print greatest of two numbers if value store in ch is ‘p’ otherwise print multiplication of
two numbers
Void compare (int n,char ch)
Print square of integer numbers if value store in ch is ‘s’ otherwise print cube of numbers
Void compare(String s1,String s2)
Print the largest string according to length of string

Answers

Answered by rohalmaibam
0

Answer:

Design a class to overload a function compare() as follows:

(a) void compare(int, int): to compare two integer values and print the greater of the two integers.

(b) void compare(char, char): to compare the numeric values of two characters and print the character with higher numeric value.

(c) void compare(String, String): to compare the length of the two strings and print the longer of the two

Explanation:

please mark me as brainliest

Similar questions