+ 2
Prime number
#include <iostream> using namespace std; int main() { double n, i, j; cout<<"Please enter a number"<<endl; cin>>n; for(i=2; i<n; i++) { if( n % i == 0) cout<<"UnRishoni"; else cout<<"Rishoni :)"; } return 0; } Hi! Someone know what is the problem in my code? I try to check if the cin number is prime. The error checker tell me that I used in double and double to make % .. What is that mean? Thank you!
3 Antworten
+ 1
But using int is better as less space would be needed keeping that extra zeroes behind.
0
Thank you!!!