WSQ12

 

Here is my code for wsq12. This program asks the user for two integer numbers and then prints the great common factor from those numbers. The program uses one for loop which creates a counter that works while being minor equal to both integer numbers. After that, it uses an “if” conditional to asign z to gcf which is a variable created to calculate the great common factor. “Z” increments one by one until it gets to a number that is capable of being divided by the two numbers given by the user, and that is why the “if” conditional asigns gcf = “z” when dividing z%first and second, and getting 0 as an answer. 

CC BY 4.0 WSQ12 by carlos green is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.