Im trying to make a program that figures out the smallest of 3 numbers entered by the user and cant get it to work.
here is my program:
---------------------------------------------------------------------
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
int smallest(int x, int y, int z);
int small;
int main()
{
int x,y,z;
cout<<"Please enter first number: ";
cin>>x;
cout<<"Please enter second number: ";
cin>>y;
cout<<"Please enter third number: ";
cin>>z;
int smallest(int x, int y, int z);
cout<<small<<" is the smallest number of the three."<<'\n';
}
int smallest(int x, int y, int z)
{
small=x;
if(small>y)
small=y;
if(small>z)
small=z;