Browse Source

refactoring: added comments

remotes/origin/ggT
cxnnqr 11 months ago
parent
commit
14a59e865e
  1. 6
      src/ggT/main.c

6
src/ggT/main.c

@ -3,10 +3,16 @@
#include <stdio.h> #include <stdio.h>
int main(){ int main(){
// Getting user input for the two numbers
printf("Please add the two numbers you want the ggT of:\n"); printf("Please add the two numbers you want the ggT of:\n");
int firstNum = usergetd("first number: ", 0, NULL); int firstNum = usergetd("first number: ", 0, NULL);
int secondNum = usergetd("second number: ", 0, NULL); int secondNum = usergetd("second number: ", 0, NULL);
// Calculating the ggT of those two numbers
int result = ggT(firstNum, secondNum); int result = ggT(firstNum, secondNum);
// Print the result
printf("The ggT of %d and %d is: %d\n", firstNum, secondNum, result); printf("The ggT of %d and %d is: %d\n", firstNum, secondNum, result);
return 0; return 0;

Loading…
Cancel
Save