I have very simple piece of code. The goal is when i input four-digit number to check and verify that is divisible by 3.
#include <iostream>
using namespace std;
int main()
{
int number;
cout<<"number: ";
cin>>number;
if(number%3==0)
{
cout<<"divisible by 3";
}else{
cout<<"not divisible by 3";
}
}
And don’t work.
I’m really really sorry. Seems the problem is in Dev++. I will delete this thread
Your program is fine. End your output lines with
endlto flush the output. If you still think it doesn’t work, explain what you are doing, what the result is, and what you expect the result to be.