Lab Assignment1 G3
Lab Assignment1 G3
Area = π × r2
2. Write a program that takes an input N and calculates the sum of the first N natural
numbers using the formula:
Sum = N × (N+1) / 2
3. Take the length and width of a rectangle as input from the user and calculate its
perimeter using the formula:
Perimeter = 2 × (Length+Width)
Area = Length x Width
Compound Interest=P×(1+R/100)^T
5. Write a program to calculate the Body Mass Index (BMI). Take the weight (in kilograms)
and height (in meters) as input, and calculate BMI using the formula:
BMI=Weight / Height^2
6. Write a Python program to calculate the sum of an arithmetic progression. Take the first
term a, common difference d, and the number of terms n as input. Use the formula:
7. Write a program to convert a temperature from Fahrenheit to Celsius. Take the
Fahrenheit value as input and use the formula:
8. Write a program to calculate and display the percentage of profit or loss based on the
cost price and selling price.
9. Write a program to input the cost price and desired profit percentage, then calculate the
selling price required to achieve that profit.
10.Write a program to calculate the profit or loss after applying a discount to the marked
price. Inputs: cost price, marked price, and discount percentage.