6
I have no idea how I’m going to determine the condition of for
for prime numbers. I always end in looping.
#include <stdio.h>
int main() {
int num = 1, primo;
do {
printf("Informe um numero primo maior que 1:");
scanf("%d", &primo);
} while (primo <= 1);
for (num=1; num<=primo; primo++){
if (primo%num==0)
printf("Numero primo",primo);
else
printf("Numero não primo",primo);
}
}
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero