diff options
author | RossTheRoss <msattr@gmail.com> | 2019-02-14 21:11:31 +0000 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-02-14 21:11:31 +0000 |
commit | f5a48f2351bea2674e1da7652a7799726f49f9e5 (patch) | |
tree | 3bfe66ef9c6abc4a931d2c12aaf5af2637aec978 /misc/test.cpp | |
parent | Merge branch 'master' of github.com:RosstheRoss/TestingFun (diff) | |
download | homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.tar homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.tar.gz homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.tar.bz2 homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.tar.lz homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.tar.xz homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.tar.zst homework-f5a48f2351bea2674e1da7652a7799726f49f9e5.zip |
Simplify things
Diffstat (limited to '')
-rw-r--r-- | misc/test.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/misc/test.cpp b/misc/test.cpp index 40e15c5..109925d 100644 --- a/misc/test.cpp +++ b/misc/test.cpp @@ -7,16 +7,17 @@ int main () { cout << "Enter a number:"; cin >> x; for (i=x; i>1; --i) - { if (x%i==0 && x!=i) { - cout << "Not prime!" << endl; + cout << x << " is not prime!" << endl; + cout << "Divisible by " << i << "." << endl << endl; a=1; break; - return i; } + } } - if (!a) - cout << "Prime!" << endl; + if (!a){ + cout << x << " is a prime number!" << endl << endl; return 0; -} + } +}
\ No newline at end of file |