If statement troubles

Hey guys,
I'm a very nooby and inexperienced programmer and am trying to get some concepts through. This script is supposed to tally the amount of votes placed into vote 1, 2 and 3. It is to accept any number of votes, but to finialise voting and print the results at the entry of 0(mine probably allows the same with any number besides 1, 2 or 3, but fixing that is easy). Everything seems to be in working order so far except the if statement, and no matter how I really word it, I struggle with it. +If it's something really stupid i promise to take a break for a while. xD

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647`` ``````#include using namespace std; int main() { int vote1=0, vote2=0, vote3=0, poll; cout<< "\n----------Welcome to the Poll!-----------"; cout<< "\n\n\\\\\\What do you think? 1, 2 or 3?/////\n\n"; cin>>poll; while (poll != 0); { if (poll == 1) { ++vote1; cout<< "\nThank you for your vote!"; cout<<"\nNext vote please. 1, 2 or 3?\n"; cin>> poll; } if(poll == 2) { ++vote2; cout<< "\nThank you for your vote!"; cout<<"\nNext vote please. 1, 2 or 3?\n"; cin>> poll; } if(poll == 3) { ++vote3; cout<< "\nThank you for your vote!"; cout<<"\nNext vote please. 1, 2 or 3?\n"; cin>> poll; } cout<< "\nThank you for your votes.\n"; cout<< "\nOption one ended on " <
Remove the semicolon after the while statement on line 12.
goddd dangggittt, haha, thanks a lot man :)
Topic archived. No new replies allowed.