Question
Write a C# program to check whether a string is palindrome or not . Test Data : Enter String : Malayalam Expected Output : String
- 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
- 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
- Write a C# application that implements a class 'number" with the following functionality.
- Three data members 'n', 'dsum' and 'rev' of integer data type.
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started