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

Hmael PF Assign3

The document contains the name and registration number of a student who submitted 19 programming questions for an assignment in CS-03A. The questions ask the student to write programs that generate random numbers within given ranges and perform basic math operations like exponents and absolute value. Most questions require the program to prompt the user for input and display corresponding output.

Uploaded by

Hmael Asif
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)
56 views12 pages

Hmael PF Assign3

The document contains the name and registration number of a student who submitted 19 programming questions for an assignment in CS-03A. The questions ask the student to write programs that generate random numbers within given ranges and perform basic math operations like exponents and absolute value. Most questions require the program to prompt the user for input and display corresponding output.

Uploaded by

Hmael Asif
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/ 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