Question: IE 1 0 0 5 - FROM COMPUTATIONAL THINKING TO PROGRAMMING AY 2 3 / 2 4 SPECIAL TERMS TAKE - HOME ASSIGNMENT 2 Instructions

IE1005- FROM COMPUTATIONAL THINKING TO PROGRAMMING AY23/24 SPECIAL TERMS TAKE-HOME ASSIGNMENT 2
Instructions
Save your source code as HW2_YourName. c and submit only HW2_YourName . c in NTULearn.
You are required to submit a video of yourself explaining the assignment solution. Refer to the instructions on video recording available in NTULearn.
You may resubmit as many times as you need until the deadline. Only the last file submitted before the deadline will be graded.
Ensure you submit the correct files. You will be graded based on the files that you submit.
Question ?()
Write a C program that finds common factors of two whole numbers. The program should do the following. The example user input is highlighted in red.
Prompt the user to enter a two-digit whole number.
Enter a two-digit whole number: 81
Generate and display a random number smaller than the user-entered number.
The second number is 63.
Compute and show their common factors.
Common factors of 81 and 63 are:
1
3
9
Display a sentence commenting on the number of common factors. The sentence should be in either singular or plural form, depending on the number of common factors.
There are 3 common factors of 81 and 63.
or
There is 1 common factor of 37 and 13.
Below are two more examples of the entire program run.
Enter a two-digit whole number: 48
The second number is 41.
Common factors of 48 and 41 are:
1
There is 1 common factor of 48 and 41.
Enter a two-digit whole number: 72
The second number is 46.
Common factors of 72 and 46 are:
1
2
There are 2 common factors of 72 and 46.
Note
You may assume that the user always provides a valid input.
Optimize your program for efficiency and easy reading.
Remember to style your code accordingly.
Marking schedule
Prompt the user and take the input
15 marks
1
 IE1005- FROM COMPUTATIONAL THINKING TO PROGRAMMING AY23/24 SPECIAL TERMS TAKE-HOME ASSIGNMENT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!