Kleine program fur begginers: ;-)
Code:
//PROGRAM FOR CALCULATING SUM AND AVERAGE OF TWO NUMBERS
#include <iostream>
#include <stdio.h>
using namespace std;
int main ()
{
float num_1, num_2;
double sum, average;
cout << "\n\t\t******************************************* ";
cout << "\n\t\t* PROGRAM FOR CALCULATING SUM AND AVERAGE * ";
cout << "\n\t\t* OF TWO NUMBERS * ";
cout << "\n\t\t* Version 1.0, February, 2004 * ";
cout << "\n\t\t******************************************* ";
cout << "\n\n\n\n\n Enter first number: ";
cin >> num_1;
cout << "\n Enter second number: ";
cin >> num_2;
sum = num_1 + num_2;
average = sum / 2.0;
cout << "\n\n Calculated sum is: " << sum << endl;
cout << "\n Calculated average is: " << average << endl;
cout << "\n\n\n\n\n For exit from program press [Enter] >>>>> ";
cin.ignore();
cin.get();
return (0);
}