Question: Write a C# program to check whether a string is palindrome or not . Test Data : Enter String : Malayalam Expected Output : String

  1. Write a C# program to check whether a string is palindrome or not .

Test Data :

Enter String : Malayalam

Expected Output :

String is Palindrome

Entered String Was malayalam and reverse string is malayalam

  1. Write a program in C# Sharp program to create a function to calculate the sum of the elements in an array and check whether sum is an Armstrong number or not, using another function.

[15 marks]

Test Data :

Enter Array limit : 5

Input 5 elements in the array :

element - 0 : 1

element - 1 : 2

element - 2 : 3

element - 3 : 4

element - 4 : 5

The sum of the elements of the array is 15

Not Armstrong Number

  1. Write a C# application that implements a class 'number" with the following functionality.
  2. Three data members 'n', 'dsum' and 'rev' of integer data type.
  3. Four public methods, readValues(),digitsum(), reverse() and dispResult()

i.readValues () - to accept the value of 'n' from the keyboard.

ii.digitsum () - to calculate the Digit sum of n.

iii.reverse () - to calculate the reverse of the number 'n'.

iv.dispResult() - to display the Digit sum and Reverse of 'n'.

In the Main method, create an object "N1" of the 'number" class, and calculate the Digit sum and Reverse using the above methods.[15 Marks]

Sample I/O

Enter a number : 1234

DigitSum = 10

Reverse = 4321

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!