int main(void)
{
int nValue1;
nValue1 = 1;
int nValue2;
nValue2 = 2;
int nValue3;
nValue3 = 2;
int nAverage;
nAverage = (nValue1 + nValue2 + nValue3) / 3;
cout << nAverage;
cin.get();
return(0);
}
keep in mind that this is just a snippet of the code, and it works properly how it is.
The thing is, i was trying to change the code so that the application would ask you for the values instead of imbedding them
within the code itself.
I tried something like this
int nValue1; cout << "Please input the value of Value1" cin >> nValue1; // as soon as i input the value, the program just closes, // even when that was the only thing i changed.
And one other problem i ran into was when i tried to use the endl function, my IDE said
statement cannot resolve address of overloaded function.
int nAverage = (nValue1 + nValue2 + nValue3) / 3; endl; cout << nAverage; cin.get()
sorry for making such a long post, but if you could answer any of my questions i would appreciate it

New Topic/Question
Reply



MultiQuote









|