Quick Question, Basic Programing
hi all,
since i am new to these forums i hope this is the right place to post this question. i am starting to teach myself how to program using c++ and the program i was trying to make did not complete all the required tasks.
in the below program it will only give the second out come for the second task: What where you thinking. You now have a virus. How to i change this program so it will say the first out come for odd numbers and the second for even.
Code:
#include <iostream>
using namespace std;
int main()
{
char name;
cout<<"What is the first letter of your operating system? ";
cin>>name;
cin.ignore();
cout<<"The first letter of your operating system is "<< name <<"\n";
int number;
cout<<"Please input a number 1-10: ";
cin>>number;
cin.ignore();
if ( number == ( 1, 3, 5, 7, 9 ) ) {
cout<<"You read my mind!\n";
}
else if ( number != (1, 3, 5, 7, 9 ) ) {
cout<<"What were you thinking. You now have a virus.\n";
}
cin.get();
}
any help is appreciated. thank you in advance.