I want a user to be able to enter 5 numbers and I want the maximum number to be displayed (and it must tell the user whether this is the 1st number, 2nd number, 3rd number (etc..) that was entered)
Example:
15 45 3 79 20
The maximum number is 79 and it is the 4th number.
Here is some code I started with, I am a beginner. Thanks for all the help. I appreciate it.
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
//-------------------------------------------------------------
int main ()
{
const int MAXNUMS = 5;
int count;
char num1, num2, num3, num4, num5;
double max;
cout << "This program will output the maximum value of 5 numbers entered.\n";
cout << "Please enter ";
cout << MAXNUMS << " numbers between 1 and 100.\n";
count = 5;
for (count = MAXNUMS; count < MAXNUMS;)
cout << "\nEnter 5 numbers: ";
cin >> num1, num2, num3, num4, num5;
cout << "The maximum number is: ";
cout << max(num1);
return 0;
}
there are errors in places and the structure is messed up. like I said, I am a beginner. Help is very appreciate. im trying to learn here. the books don't help... experience will.