// Eksemp2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <conio.h>

using namespace std;


int LaesInt(string Tekst)
{
	int Tal;
	cout << Tekst.c_str();
	cin >> Tal;
	return Tal;
}

float Beregning(int Tal1, int Tal2, int Tal3)
{
	int Resultat;
	Resultat = (Tal1 + Tal2) / Tal3;
	return Resultat;
}

int _tmain(int argc, _TCHAR* argv[])
{
	int Tal1, Tal2, Tal3;
	Tal1 = LaesInt("Indtast 1. tal: ");
	Tal2 = LaesInt("Indtast 2. tal: ");
	Tal3 = LaesInt("Indtast 3. tal: ");
	if (Tal3 != 0)
	{
		cout << "Resultatet er: " << Beregning(Tal1, Tal2, Tal3);
	}
	else
	{
		cout << "Beregning er umulig";
	}
	getch();
	return 0;
}

