Message from C, C++ talks

June 2019

— You can format error messages too. The code formatting is not restricted to code

— Ok

— It's IDE configuration

— That he's trying to do

— 

Hello I am called Steve and new in CPP i have a problem with writing a program that prints prime number >=50

— Please \

— Well tell us what the problem is

— Just a simple program that will print prime number out on the screen

— And what exactly is your problem?

— What have you tried? Some code?

— Print prime number out on the screen

— Okay let me send you the code then

— Send it here, not to me

— #include <iostream>

using namespace std;

int main()

{
int a;
int d=2;
cout << "Please enter your number \n";
cin>>a;
for( d>=a; d++){
if(a%d!=0){
cout << "prime\n";
}
else {
cout << "Not prime \n";
}
}

return 0;
}

Message permanent page

— But is not working