Computer Hardest Question Answer
Computer Hardest Question Answer
6) Write program with the class name overloading to find the area of the square, area of circle and
area of a rectangle methods name area() [overloading methods], main() – accept all the
necessary values from the user and call the methods by call by value.
7) Write a class to check whether a given number is Armstrong or not using a function.
int checkArmstrong(int num)- should return a value 1 if number is Armstrong otherwise it return 0
if not.
Main() – create the object, input the value and call the method and display the value Armstrong or
not.
8) Write a class program SERIES with a function by using following specifications- int fact(int).
The function calculates and returns factorial of a number. Apply this function to find the sum of the
following series and display the result in main-function.
(Note : n! = 1 x 2 x 3 x.......x n )
S = 1 + 1 + 1 +……………+1
2! 4! 6! 10!
9) Write a class palindrome with the function palin() to display all 3 digit palindrome numbers.
main() create the object and call the function palin().
**********