+ 2
Prime Number
Someone could tell me if this code about prime numbers is it okay? Thanks #include <iostream> using namespace std; int main() { int rest=0; int num; int *dir_num; dir_num = # cout<<"Intrudicir un valor: "<<endl; cin>>num; for(int i=2; i<*dir_num; i++){ if((*dir_num%i)==0){ rest=*dir_num%i; rest++; } } if(rest%2!=0){ cout<<"El numero "<< *dir_num<< " NO es primo." << endl; cout<<"Posicion: "<< dir_num; } else{ cout<<"El numero "<< *dir_num << " SI es primo."<< endl; cout<<"Posicion: "<<dir_num; } return 0; }
41 Respuestas
+ 3
I found answer for you, it's here ↓↓↓ :)
https://stackoverflow.com/questions/5200879/printing-prime-numbers-from-1-through-100
+ 3
@Charan Leo25
this is spam, please delete it :)
Or write a normal answer so people can understand you :)
+ 3
👍
+ 1
thansk you
+ 1
If (x%2==0){
System.out.println("x is even number
}
else {
System.out.println{"x is odd number}
+ 1
give me your number and tell me country from u coz I have to search your isd code
+ 1
i dont want to give out my number
+ 1
what country do u live in
+ 1
i tried
+ 1
India
+ 1
ur not popping up on whatsapp
0
I don't know about this but I can give you easy way
0
hey ravi
0
i dont see ur whatsapp
0
did u get my text ?
0
tell me u r number with isd code
0
isd code?
0
ok save my number with 91
0
what do u mean ?
0
i wish solo learn had private message . it would make things way easier