this task has 4 branches and i currently solved the first one with searching the same multiplier of a and b
#include <stdio.h>
int kgV(int a, int b){
int a0=a;
int b0=b;
int kgv=0;
if(a>b){
a+=a0;
while(a%b != 0){
a += a0;
}
kgv=a;
} else{
b+=b0;
while(b%a !=0){
b+=b0;
}
kgv=b;
}
return kgv;
}
int main(){
int a,
b;
printf("Type a \n");
fflush(stdout);
scanf("%d",&a);
printf("Type b \n");
fflush(stdout);
scanf("%d",&b);
printf("kgV of a[%d] and b[%d] is %d", a, b, kgV(a, b));
return 0;
}