#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int num1;
int num2;
printf("Enter integer 1 : ");
int a = scanf("%d", &num1);
printf("Enter integer 2 : ");
int b = scanf("%d", &num2);
while (1)
{
if (num1 >= num2)
{
if (num1 % num2 == 0) ;
printf("a");
printf("Maximum number of pledges: %d",num2);
break;
}
else {
num1 = num2;
num2 = num1 % num2;
}
}
else if (num1 < num2)
{
if (num2 % num1 == 0) {
printf("Maximum number of pledges: %d", num1);
break;
}
else {
num2 = num1;
num1 = num2 % num1;
}
}
}
return 0;
}
If you put 50 to 10 in the whole number, it'll come out right 4836 If you put it in like this, the printf itself won't come out
c c++ error
You have to debug these things yourself to improve your skills.
I think you're using a visual studio, so learn how to breakpoint (f9), how to run it in debugging mode (f5), and how to run it in one line (f10).
© 2024 OneMinuteCode. All rights reserved.