1. ## Prime Factor

Code:
```#include <stdio.h>

int main(){
int i, j, num, num1, isPrime;

scanf("%d %d", &num, &num1);

for(i = 2; i <= (num % num1); i++){
if((num % num1) % i==0){
isPrime = 1;
for(j = 2; j <= i / 2; j++){
if(i % j == 0){
isPrime = 0;
break;
}
}
if(isPrime == 1){
printf("%d ", i);

}
}
}
return 0;
}```
Want to ask that is the main prime factor if for example the input 6 12 then the result is 6 but the coding instead has 2 3.

Input:
6 12
Output:
6

Enable GingerCannot connect to Ginger Check your internet connection

2. Originally Posted by Suntani
Code:
```#include <stdio.h>

int main(){
int i, j, num, num1, isPrime;

scanf("%d %d", &num, &num1);

for(i = 2; i <= (num % num1); i++){
if((num % num1) % i==0){
isPrime = 1;
for(j = 2; j <= i / 2; j++){
if(i % j == 0){
isPrime = 0;
break;
}
}
if(isPrime == 1){
printf("%d ", i);

}
}
}
return 0;
}```
Want to ask that is the main prime factor if for example the input 6 12 then the result is 6 but the coding instead has 2 3.

Input:
6 12
Output:
6

Enable GingerCannot connect to Ginger Check your internet connection
And so if you are looking for prime numbers between the two numbers, what your complaint about 2 * 3 = 6 have to do anything with the question? Why is the title of your question "prime factor" instead of a more appropriate "prime numbers"
Enable GingerCannot connect to Ginger Check your internet connection