using IF statements

Hello World!!
I am trying to compile a program whereby the user in puts 3 numbers in a loop.
Within the loop i then try to assign the users numbers to variables i have already declared using IF statements. I am obviously doing something wrong as its acting strange as soon as i add the IF statements. Basically i am asking is it possible to use IF statements within a DO WHILE loop and if so can you show me please. #include<iostream>
using namespace std;

int number, total=0, num1, num2, num3;
int count=0;
void main()
{
do
{
cout<<"enter a number :";
cin>>number;
total = total + number;
count++;
if (count=2)
num1=number;
if (count=2)
num2=number;
if (count=3)
num3=number;
}
while (count!=3);
cout<<total;
cin.get();
cin.get();
}

this is my program so far. It works fine when i speech out the IF's
In your if statements, use == for comparison. A single = is assignment. Also, use [code][/code] tags in the future.
Thankyou Zhuge! Your helpful guidance is most appreciated!!
Topic archived. No new replies allowed.