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

Programming Homework 3

Uploaded by

mhodarham3
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)
11 views1 page

Programming Homework 3

Uploaded by

mhodarham3
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

Programming Homework 3

Assign Date: 04-11-2024 Due Date: 04-11-2024


Modify the last program did in today's class.
Pre Task: Modify following statement:
n1 = rand(), n2 = rand(), n3 = rand();
n1 = rand() % 20, n2 = rand()% 20, n3 = rand()% 20;
Q1. Print numbers from min to max in one line. Run another loop and print numbers from max to min.
Q2. Print pair of numbers in separate lines starting from min, max. Increment min by one and decrement max by
one. Continue until they become equal or max becomes smaller than min
Q3. Print pair of numbers in separate lines starting from min, max. Increment min by one and decrement max by
one. Continue until max becomes equal to the original value of the min.
Hint: Use an extra variable to store original value of min to put the condition in the loop
Q4. Print numbers from min to max. Also compute and print their sum and average (in float).

You might also like