hi , i had a problem with one of my programs im pretty sure everything is correct but when i run it it only asks me to input the last name but it would just print out the rest and not ask for any other input why is that? can someone help me what am i doing wrong.
the program is suposed to ask for the last name first name and 3 test scores for that person. then output the average of the test scores
#include <iostream>
using namespace std;
int main()
{
int first;
int last;
int num1;
int num2;
int num3;
cout<<" Enter your last name :";
cin>> last;
cout<<" Enter your last name :"<<endl;
cin>>first;
cout<<endl;
cout<< "enter three test scores :"<<endl;
cin>> num1, num2, num3;
cout<<endll;
cout<< average of test scores is :"<<double((num1 + num2 + num3) /3.0)<<endl;
return 0;
}
it doesnt ask for first name or to enter the test scores it just asks for the last name then compiles the rest and the average comes out to be this wierd negative number. can someone please help?