Answer the question
In order to leave comments, you need to log in
Why doesn't my C code work?
you need to make a program that decomposes any number into prime factors
#include <stdio.h>
int main(void){
int nUm,d;
scanf("%d", &d);
d=2;
while (nUm >= 1){ //цикл вывода простых делителей
if(nUm % d == 0){
printf("%d", d);//распечатываем простой делитель
nUm = nUm % d;// делим на него
d=2; //обнуляем переменную d
}else{
d++;
}
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
Judging by the code, where it is written scanf("%d", &d);
meant scanf("%d", &nUm);
.
nUm = nUm % d;// делим на него
nUm = nUm / d;// делим на него
d=2; //обнуляем переменную d
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question