0% found this document useful (0 votes)
3 views12 pages

(Merge) Lab-Programs

The document outlines a series of programming tasks for students in the Department of IT at RGUKT. These tasks include converting days to years, weeks, and days, calculating marks and grades, checking for leap years, and various number-related programs such as finding maximum values, checking divisibility, and identifying prime and perfect numbers. Additionally, it includes tasks related to string manipulation and pattern generation using loops.

Uploaded by

abotulaniranjan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views12 pages

(Merge) Lab-Programs

The document outlines a series of programming tasks for students in the Department of IT at RGUKT. These tasks include converting days to years, weeks, and days, calculating marks and grades, checking for leap years, and various number-related programs such as finding maximum values, checking divisibility, and identifying prime and perfect numbers. Additionally, it includes tasks related to string manipulation and pattern generation using loops.

Uploaded by

abotulaniranjan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RGUKT Department of IT

1. Write a program to convert days into years, weeks and days. Read number of days
from user as input

2. Write a program to enter marks of five subjects and calculate total, average
and percentage.

3. Write a program to input three numbers and find maximum between three.

4. Write a program to input any year and check whether it is leap year or not.

5. Write a program to input any number and check whether it is divisible by 5


and 11 or not.

6. Write a program to input any character and check whether it is alphabet,


digit or special character.

7. Write a program to input cost price and selling price of a product and
calculate profit or loss.

8. An electric power distribution company charges its domestic customers


as follows:
Consumption Units Rate of Charges (Rs)
0-50 1.35 per unit
51-100 2.60 per unit
101-200 2.85 per unit
201-300 4.50 per unit
301-400 5.00 per unit
Above 400 5.75 per unit
Write a program to accepts customer number and number of units consumed and prints
the amount to be paid by the customer

P NABIRASOOL Subject: Computer Programming


RGUKT Department of IT

9. Write a Python program to pay computation to give the employee 1.5times the
hourly rate for hours worked above 40 hours.

Enter Hours: 45
Enter Rate: 10
Pay: 475.0
10. Write a program to prompt for a score between 0 and 100. If the score is out of
range, print an error message. If the score is between 0 and 100, print a grade
using the following table: Score Grade

>=90 EX
>=80 A
>=70 B
>=60 C
>=50 D
<50 Fail
11. Write a program to input basic salary of an employee and calculate its Gross salary
according to following:
Basic Salary <=10000: HRA=20%, DA=80%
Basic Salary <=20000: HRA=25%, DA=90%
Basic Salary > 20000: HRA = 30%, DA = 95%

12. Write a program to print all natural numbers in reverse (from N to1).

13. Write a program to print all even numbers between 1 to N. using while loop

14. Write a program to print sum of all even numbers between 1 to N.

15. Write a program to enter any number and calculate sum of its digits.

16. Write a program to enter any number and find its first and last digit.

17. Write a program to enter any number and check whether the number
is palindrome or not.

18. Write a program to enter any number and print all factors of the given number.

19. Write a program to enter any number and check whether it is


Armstrong number or not. (a number that is equal to the sum of its
own digits, each raised to the power of the total number of digits.
Ex: 153, 370, 371, 1634)
P NABIRASOOL Subject: Computer Programming
RGUKT Department of IT

20. Write a program to enter any number and check whether it is Perfect number
or not. (a positive integer that is equal to the sum of its proper positive
divisors excluding the number itself. Ex: 6, 28, 496)

21. Write a program to enter any number and check whether it is Strong number
or not. ( a number that equals the sum of the factorials of its individual digits.
ex:1, 2, 145, 40585)

22. Write a program to print all Prime numbers between 1 to N.

23. Write a program to print all Perfect numbers between 1 to N.

24. Write a Python program that accepts a string and calculate the number of
alphabets, digits and special characters.

25. Write a Python program to construct the following pattern, using a nested
loop number. Read the input from user, if we give 9 as input following is the
expected output

P NABIRASOOL Subject: Computer Programming

You might also like