Functions
(Assignment Questions)
Question 1 : Write a function to check if a number is a palindrome in C++.
(121 is a palindrome, 321 is not)
A number is called a palindrome if the number is equal to the reverse of a number.
Eg : 121 is a palindrome because the reverse of 121 is 121 itself. On the other hand, 321
is not a palindrome because the reverse of 321 is 123, which is not equal to 321.
Question 2 : Write a function to calculate the sum of digits of a number.
Question 3 : Write a function which takes 2 numbers as parameters (a & b) and
outputs : a^2 + b^2 + 2*ab.
Question 4 : Write a function that prints the largest of 3 numbers.
Question 5 : Write a function that accepts a character (ch) as parameters & returns
the character that occurs after ch in the English alphabet.
Eg : input = ‘c’, return value = ‘d’
Note : for ch = ‘z’, return ‘a’.