Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IE 1 0 0 5 - FROM COMPUTATIONAL THINKING TO PROGRAMMING AY 2 3 / 2 4 SPECIAL TERMS TAKE - HOME ASSIGNMENT 2 Instructions
IE FROM COMPUTATIONAL THINKING TO PROGRAMMING AY SPECIAL TERMS TAKEHOME ASSIGNMENT
Instructions
Save your source code as HWYourName. c and submit only HWYourName 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 twodigit whole number.
Enter a twodigit whole number:
Generate and display a random number smaller than the userentered number.
The second number is
Compute and show their common factors.
Common factors of and are:
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 common factors of and
or
There is common factor of and
Below are two more examples of the entire program run.
Enter a twodigit whole number:
The second number is
Common factors of and are:
There is common factor of and
Enter a twodigit whole number:
The second number is
Common factors of and are:
There are common factors of and
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
marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started