0% found this document useful (0 votes)
42 views

Assignment File1

The document outlines 12 programming assignments: 1) find sum of digits of a 4-digit number, 2) reverse a 4-digit number, 3) determine if a 4-digit number is "ordered", 4) check if a number is Armstrong, 5) check if a number is perfect, 6) check if a number is circular, 7) calculate LCM and GCD of two numbers, 8) generate Fibonacci series up to a given number, 9) calculate income tax based on slabs, 10) convert a number to a word statement, 11) create a menu-driven program for basic math operations, 12) print three patterns.

Uploaded by

Aman Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Assignment File1

The document outlines 12 programming assignments: 1) find sum of digits of a 4-digit number, 2) reverse a 4-digit number, 3) determine if a 4-digit number is "ordered", 4) check if a number is Armstrong, 5) check if a number is perfect, 6) check if a number is circular, 7) calculate LCM and GCD of two numbers, 8) generate Fibonacci series up to a given number, 9) calculate income tax based on slabs, 10) convert a number to a word statement, 11) create a menu-driven program for basic math operations, 12) print three patterns.

Uploaded by

Aman Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment I

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)

153 is Armstrong number

5. Write a program to check a number for perfect e.g. 6 is a perfect number.


6. A whole number is said to be circular if when you multiply the number by its units
decimal digits the result is the number with its decimal digit rotated to the the firth with
the using digit becoming it is high order digit. For example 102564 is a circular number
because in the multiplication
102564
X 4
------------410256
------------taking 4 at the right of 102564 and moving it to the left to get 410256 can form the
resulting number. Write a program to test whether a given number is a circular.
7. Write a program to calculate LCM and GCD of two numbers.
8. Write a program to generate the Fibonacci series upto a given number.
9. Income tax for individual is computed on slab rates as follows.
Income
Tax payable
Upto Rs. 50,000
Nil
From Rs. 50,001 to Rs. 60,000
10% of the excess over Rs. 50,000
From Rs. 60,001 to Rs. 1,00,000
20% of the excess over Rs. 60,000
Above Rs. 1,00,000
30% of the excess over Rs. 1,00,000
Write a program that reads the income and print the income tax due.
10 Convert a number to a word statement e.g. 1245 converted to One thousand two
hundred and forty five.

.
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

You might also like