#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).
776 M2 Mac fails to install rbenv install 3.1.3 due to errors
1235 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
771 GDB gets version error when attempting to debug with the Presense SDK (IDE)
856 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2025 OneMinuteCode. All rights reserved.