0% found this document useful (0 votes)
28 views

Lab Assignment For Week 7: CS1100 (April-June 2021) : Introduction To Programming

This document provides instructions for Lab Assignment Week 7 in CS1100 Introduction to Programming. Students are asked to write a program that prints the greatest common divisor (GCD) and least common multiple (LCM) of every unique pair of numbers between 110 and 125 (excluding both endpoints) using functions previously written to calculate GCD and LCM. The program must include comments explaining all important statements and outputs and results cannot be hardcoded.

Uploaded by

Sai naveen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Lab Assignment For Week 7: CS1100 (April-June 2021) : Introduction To Programming

This document provides instructions for Lab Assignment Week 7 in CS1100 Introduction to Programming. Students are asked to write a program that prints the greatest common divisor (GCD) and least common multiple (LCM) of every unique pair of numbers between 110 and 125 (excluding both endpoints) using functions previously written to calculate GCD and LCM. The program must include comments explaining all important statements and outputs and results cannot be hardcoded.

Uploaded by

Sai naveen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab Assignment for Week 7

CS1100 (April-June 2021): Introduction


to Programming
Instructors: Shweta Agrawal, Deepak Khemani, C Siva Ram Murthy, V.
Krishna Nandivada, Meghana Nasre.
Lead Teaching Assistants:
Viswajit Vishnu. Email: [email protected] . Sriharsha
Chigullapally. Email: [email protected] . Koushik Kiran Kumar.
Email: [email protected] .

Instructions:
1.Your program MUST have comments written for all the important
statements explaining their functionality/purpose. A program with
insufficient set of comments will be penalized 15% of the grade.
2. Each required output must start from a separate line.
3. Hardcoding results to pass test cases will incur penalty.

Question 3:
Write a program that prints the GCD and LCM of every pair of numbers
between 110 and 125 (excluding both). In each pair, both numbers should
be different and order should not be considered, i.e. , there will be just 1
pair corresponding to (a,b) and (b,a).

For each pair of numbers, output the GCD and LCM separated by a
single space, followed by a newline.

The following should be the sequence in which you use the pairs :

(111,112) , (111,113) , … , (111,124) , (112,113) , (112,114) , … , (123,124)

Your program should use the functions GCD and LCM you have written in
Question 1 and 2 to compute the GCD and LCM of every pair of numbers.

You might also like