Return Last 50 posts First 100 posts
help me out /lounge/rs what did i miss
1 Name: Anonymous : 2017-05-08 22:44
#include <iostream>
using namespace std;
int main()
{
int num1,num2,num3,max,min,sum;
float avg;
cout << "Please Enter num1:";
cin >> num1;
cout << "please Enter num2:";
cin >>num2;
cout << "\please Enter num3:";
cin >>num3;
sum = num1+num2+num3;
max =num1;
if (num2>max)
max = num2;
if (num3>max)
max = num3;
min = num1;
if (num2<min)
min = num2;
if (num3<min)
min = num3;
avg = (sum)/3.0;
cout "\n\nThe sum of these numbers is = " << sum;
cout <<"\n\nThe highest number is = " << max;
cout <<"\n\nThe lowest numbers is = " << min;
cout <<"\n\nThe average is = " << avg;
return 0;
}
2 Name: Anonymous : 2017-05-08 22:55
Well, off the top of my head, "cout "\n\nThe sum of these numbers is = " << sum;" is missing a << after the cout.
3 Name: Anonymous : 2017-05-08 23:00
Why do you have an escape character next to the p on line 12?
4 Name: Anonymous : 2017-05-08 23:08
5 Name: Anonymous : 2017-05-08 23:16
>>1,4Back to /Prog/ please!
6 Name: Anonymous : 2017-05-08 23:23
>>1Use arrays and loops. Dear god.
7 Name: Anonymous : 2017-05-08 23:28
>>6meh it runs it's good enough
8 Name: Anonymous : 2017-05-08 23:33
>>7Yeah but you should take the time to learn to do it properly. Will benefit you in the long term.
9 Name: Anonymous : 2017-05-08 23:36
He pretty obviously IS in the middle of learning it.
10 Name: Anonymous : 2017-05-08 23:39
>>8I am 2 weeks in to this, but your advice is much appreciate thank you, arrays and loops are still new to me
11 Name: Anonymous : 2017-05-08 23:44
>>10pastebin com / w799PqSr
Here's your function with arrays and loops
12 Name: Anonymous : 2017-05-08 23:53
initialize all variables
13 Name: Anonymous : 2017-05-08 23:56
be careful when using max and min with various nums. make sure that the sum = sum ass.
14 Name: Anonymous : 2017-05-08 23:59
Return Last 50 posts First 100 posts