0% found this document useful (0 votes)
7 views1 page

ASSIGN-2 - Loops and Conditional MTC 233

Uploaded by

Komal Rathod
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)
7 views1 page

ASSIGN-2 - Loops and Conditional MTC 233

Uploaded by

Komal Rathod
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
You are on page 1/ 1

MTC - 233 2022-23 Assignment 2 :

Unit 3: Iterations and Conditional statements :

(using input() and print(), for and while loops and conditional stmts. )

Write Python Programs to:


1. Find whether the input number is positive, negative or zero .
2. Calculate the Area of a Triangle when height and base are given as an input.
3. Check if a Number is Odd or Even.
4. Check given is Prime Number or composite number.
5. Check whether given is perfect / Armstrong Number.
6. Convert Celsius temperature to Fahrenheit .
7. Check given year (yyyy form) is a Leap Year.
8. Calculate the volume and surface area of a sphere given its radius.
9. Calculate the cost per square inch of a circular pizza, given radius and price.
10. Print First 10 natural numbers and their square roots using while loop.
11. Input a number and count the total number of digits in a number, also
print the sum of all digits in the number .
12. Display -10 to -1 and their cubes using for loop.
13. Find the Factorial of a Number using while loop. (Not using built in
python function )
14. Find the addition and product of given n natural numbers.
15. Find the square of odd numbers from 1 to 20 using while loop.
16. Find the first 10 terms of Fibonacci sequence starting with given first two
terms.
17. Print the table of 29 using for loop.
18. Find the numbers between 1 and 100 which are divisible by any of 2, 3
and 5.
19. Reverse the digits of given integer using any loop.
20. Generate U(n) the set of prime residue classes modulo n for given n using
gcd function. Also write multiplicative inverse mod n for each element in
this set U(n).
----------------------------- * -----------------------------

You might also like