int doubles (int d);
int minimum (int m, int n);
int oddEven (int a);

int main ()
{

	int num, i, sum=0, num1, num2;

	for (i=0; i<5; i++)
	{

		cout<<"please enter a number. ";
		cin>>num;
		cout<<endl;
		sum= sum + num;

	}

	cout<<"the numbers added together is "<<sum<<endl;
	cout<<"the sum of the 5 numbers doubled is "<<doubles(sum)<<endl;
	cout<<endl;

	
	int oOrE=oddEven(sum);

	if (oOrE == -1)
		cout<<"the sum is odd"<<endl;
	else
		cout<<"the sum is even"<<endl;

	cout<<"please enter a number. ";
	cin>>num1;
	cout<<endl;

	cout<<"please enter a number. ";
	cin>>num2;
	cout<<endl;

	cout<<"the minimun of the two numbers is "<<minimum(num1, num2)<<endl;


	
return 0;
}



int doubles (int d)
{
	d=d*2;

	return d;

}

int minimum (int m, int n)
{

	int mini;

	if (m<n)
		mini=m;

	else 
	    mini=n;

	return mini;
}

int oddEven (int a)
{
	int oE;

	if (a%2!=0)//odd
		oE= -1;
		
	
	else 
		oE=1;
		
	return oE;


}
*/

Recommended Answers

All 3 Replies

People here are not psychic. Kindly explaing what problem are you having with the code.

add this to the top of your program

#include <iostream>
using namespace std;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.