You are on page 1of 12

Name: Hmael Asif

Registration no.:
220201052
Submitted to: Sir Nadeem
CS-03A
PF Assignment no.3
Q1: Write a program that generates and prints 50 random integers, each between 3 and 6.

input:

Output:
Q2: Write a program that generates a random no., x, between 1 and 50, a random number y between 2
and 5, and contains x^y.

Input:

Output:

Q3: Write a program that generates a random no. between 1 and 10 and prints your name that many
times.

Input:
Output:

Q4: Write a program that generates a random decimal number between 1 and 10 with two decimal
places of accuracy. Examples are 1.23,3.45,9.80, and 5.00.

Input:

Output:
Q5: Write a program that generates 50 random numbers such that the first number is between 1 and 2,
the second is between 1 and 3, the third is between 1 and 4, …, and the last is between 1 and 51.

Input:

Output:
|𝑥−𝑦|
Q6: Write a program that asks the user to enter two numbers, x and y, and compute 𝑥+𝑦

Input:

Output:
Q7: Write a program that asks the user to enter an angle between -180⁰ and 180⁰. Using an expression
with the modulo operator, convert the angle to its equivalent between 0⁰ and 360⁰.

Input:

Output:

Q8:
Q9:

Q10:
Q12:

Q11:

Q13:

Q14:

Q15:
Q16:

Q17:
Q18:
Q19:

You might also like