Assignment File1
Assignment File1
1. Write a program to find the sum of digits of a give four digit number.
2. Write a program to reverse the given four digit number.
3. A 4 digit number WXYZ is called an ordered number if the difference between the first
two digits, WX and the last two digits YZ is eqal to 1(WX-YZ=1 or YZ-WX=1) for
example 1213 and 4645 are ordered numbers, while 2345 and 7685 are not ordered
numbers. Write a program that will only accept a 4-digit number and determines whether
it is ordered number or not.
4. Check a number for Armstrong number e.g.
(1*1*1+5*5*5+3*3*3=153)
.
11. Write a program to print Menu driven program:1. Add
2. Multiply
3. Subtract
4. Divide
5. Exit
Enter choice:
12. Pattern printing
1)
A
ABA
ABCBA
ABCDCBA
2)
3) A B C B A
AB
A
AB
B A
A
B A
A B C B A