the correct answer will be :
# include <stdio.h>
int main(void)
{
int x;
int i;
int isprime;
Type: Posts; User: vin_320
the correct answer will be :
# include <stdio.h>
int main(void)
{
int x;
int i;
int isprime;
why its wrong ?
i have calculated by hand and it gives the correct answer
below 10 it gives 17
below 15 it gives 41
and when i run the program it gives 1324301603
finally i got the right answer :
# include <stdio.h>
int main(void)
{
int x;
int i;
int isprime;
of course i have tried it but i was getting wrong result :frown:
however, i post it because i need someone to correct me
so it will be something like this :
there is too much info. i dont know what to use
and i need to finish as fast as possible
i don't know my brain will explode now ><"
i tried it but i got wrong also ><
# include <stdio.h>
// function declration
int isPrime(int x);
for (i=2;i<=10;i++) // i'm testing the prime numbers which less than 10
for (x=2;x<=10;x++)
if (i%2!=0)
if(i%x==0)
like i said:
prime number can is dividable by one and itself
correct me if i'm wrong plz
okay , i need loop to check it whether it's prime or not
prime number can is dividable by one and itself
so i think i should use loop
for (i=2;i<=10;i++) // i'm testing the prime numbers...
what condition i have to use to check if the numbers prime or not ?
can you explain them in more details plz?
of course, i have googled it but i can't understand it
yeah i know what prime number is by hand
and this was my last try :
# include <stdio.h>
int main(void)
{
int x;
my problem is how to determine a number is prime or not ><
hi :o
i have to calculate the sum of prime numbers below 500,000
someone help me plz:frown: