Professional Documents
Culture Documents
PF (Assignment 2)
PF (Assignment 2)
Wah Campus
Assignment # 02
Programming Fundamentals
SUBMITTED BY:
FA22-BCS-144-Ahmad Ali
SUBMITTED TO:
Mr. Taimur Sajjad
Date: 3/25/23
Which of the following is the possible output from the invoking rand()?
323.4, 5, 34, 1, 0.5, 0.234
The output of the rand () function are integers, so the possible output of this rand ()
function is 5, 34 and 1.
a) How do you generate a random integer I such that 0<=i<20?
Output:
Output:
d) Find out what RADN_MAX is on your machine.
Output:
Question 2
Write a program which ask user to generate a random number between 1
and 3 and print apple if random number is 1, prints grapes if random
number is 2 and prints peach if random number is 3 (using switch
statement)
Output: