+ 1

Please, do tell me where are the error bcs i couldn't save it. Q: if the number can be divided by 5&3. I'm just a beginner.Tq!

#include <iostream> using namespace std; int main () { int number ; cout<< "Insert a number" ; if (number%5=0) cout<< "The number CAN be divided by 5"; cin>>number; else cout<<" The number CANNOT be divided by 5; end if if (number%3=0) cout<<" The number CAN be divided by 3"; cin>>number; else cout<< "The number CANNOT be divided by 3" ; end if return 0; }

1st Mar 2018, 10:36 AM
Nur AieNa
Nur AieNa - avatar
4 Respostas
+ 8
@James's fix worked because By using = you assign a value to something. By using == you check if something is equal to something else.
1st Mar 2018, 11:10 AM
David Ashton
David Ashton - avatar
+ 12
use codeplayground to post codes... 😃
1st Mar 2018, 11:10 AM
Vukan
Vukan - avatar
+ 8
To follow up on @Vukan's suggestion (which is a really good one), if you want help with a particular bit of code, you can save it in the Code Playground and share it so we can check it out (three dots joined by 2 lines in the corner -> share -> copy to clipboard -> paste in Q&A with your question)
1st Mar 2018, 11:15 AM
David Ashton
David Ashton - avatar
+ 2
Tq james!! Can be run! Yeay!! 😁😁😁
1st Mar 2018, 10:50 AM
Nur AieNa
Nur AieNa - avatar