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

Assignment 1

The document outlines a series of programming tasks that involve printing statements, performing mathematical calculations, and using conditional statements. It includes programs for basic arithmetic operations, conversions, interest calculations, and checks for conditions such as equality, leap years, and triangle validity. Additionally, it covers more complex calculations like electricity bills, student grades, and gross/net pay based on specified conditions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Assignment 1

The document outlines a series of programming tasks that involve printing statements, performing mathematical calculations, and using conditional statements. It includes programs for basic arithmetic operations, conversions, interest calculations, and checks for conditions such as equality, leap years, and triangle validity. Additionally, it covers more complex calculations like electricity bills, student grades, and gross/net pay based on specified conditions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM USING PRINTING STATEMENT AND MATHEMATICAL

CALCULATION

1. Write a program to print a statement.


2. Write a program to add two numbers.
3. Write a program to multiply two numbers.
4. Write a program to demonstrate Arithmetic operation.
5. Write a program to convert Celsius to Fahrenheit.
 Formula: Fahrenheit = Celsius * 1.8 + 32.
6. Write a program to find the simple and compound interest.
 Formula: Simple interest: (p*n*r) / 100
 Compound interest: p*pow((1+r/100),n)
7. Write a program to swap the values of two variables.
8. Write a program to calculate the power of given value.
9. Write a program to find the area of circle.
 Formula: Area of Circle = Pie * pow(r,2)
 Note : Pie value is 3.14
10. Write a program to solve a given quadratic equation
11. Write a program to sort three numbers using simple if statements.

USING IF ELSE STATEMENT

1. Write a program to check whether the given two numbers are equal or not.
2. Write a program to check whether the given year is leap year or not.
3. Write a program to check whether the given number is odd or even.
4. Write a program to find whether the given number is positive or negative.
5. Write a program to find the biggest number among 3 numbers using if else statement.
6. Write a program to sort three numbers using if else statements.
7. Write a program to check whether a triangle is valid or not, when the three angles of
the triangle are entered through the keyboard. A triangle is valid if the sum of all the
three angles is equal to 180 degrees.
8. Write a program to calculate the electricity bill using if else statement.
 If a unit consumed is below 100, cost per unit is Rs. 2.50.
 If unit consumed is between 100 to 250 cost per unit is Rs. 4.00.
 If unit consumed is above 250 cost per unit is Rs 5.00
9. Write a program to calculate the grade of the student, given the mark.
 If mark is equal to and above 90, grade is “S”.
 If mark is between 80 and 89, grade is “A”(inclusive of both limits).
 If mark is between 70 and 79, grade is “B” (inclusive of both limits).
 If mark is between 60 and 69, grade is “C” (inclusive of both limits).
 If mark is between 50 and 59, grade is “D” (inclusive of both limits).
 If mark is below 50, then the grade is “U”.
10. Write a program to find the maximum and minimum number from a given set of
numbers.
11. Write a program to calculate Gross pay and Net pay based on the following condition.
 If Basic Pay is > 15000 then HRA is 10% of Basic Pay else 5% of Basic
Pay.
 Dearness Pay = 10% of Basic Pay.
 Dearness Allowance = 18% of (Basic Pay + Dearness Pay).
 CCA = 500, MA = 200, GPF = 20% 0f (Basic Pay + Dearness Pay).
 FBF = 10% of (Basic Pay + Dearness Pay), IT = 700.
 Gross Pay = Basic Pay + Dearness Pay + Dearness Allowance + HRA + CCA +
MA.
 Deductions = GPF + FBF + IT.
 Net Pay = Gross Pay – Deductions.
11. Write a program to calculate the roots of quadratic equation.

You might also like