+ 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; }
7 Answers
+ 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.
+ 12
use codeplayground to post codes... š
+ 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)
+ 2
Tq james!! Can be run! Yeay!! ššš