Hello
I'm haveing a problem running my program because i keep getting error C2447: '{' : missing function header (old-style formal list?). Can someone explain to me how to fix this problem? Below is a copy of my program. The program is designed to take three number inputed buy the user and determine which one is the highest.
#include "stdafx.h"
#include "conio.h"
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using namespace std;
// function maximum definition;
// x, y and z are parameters
float maximum(float x, float y, float z);
{
double x; // assume x is largest
double y;
double z;
if (x > y) && (x > Z)
maximum = x
else
if (y > x) && (y > z)
maximum = y
else
if (z > x) && (z > y)
maximum = z
return maximum; // max is largest value
} // end function maximum
float maximum(float number1, float number2, float number3); // functional prototype
int main()
{
double number1;
double number2;
double number3;
cout << "Enter three floating-point numbers: ";
cin >> number1 >> number2 >> number3;
// number1, number2 and number3 are arguments to
// the maximum function call
cout << "Maximum is: " << number1 << number2 << number3 << endl;
return 0; // indicates successful termination
} // end main