All pastes #371720 Raw Edit

Untitled

public text v1 · immutable
#371720 ·published 2007-02-25 16:14 UTC
rendered paste body
#include <iostream>

using namespace std;

int main()
{
    float x,e=1; // a hatvanyozando valos szam es az eredmeny
    int n,i=0; // hatvany kitevoje, ciklusvaltozo

	cout << "Kérlek add meg a hatvány alapját!" << endl;
	cin >> x;
    cout << endl << "Most add meg a hatvány természetes kitev&#337;jét!" << endl;
    cin >> n;

    if(n<0){
        cout << "HIBA! Termeszetes szamot kell megadni!" << endl;
        char c; cin >> c;
        exit(1);
    }

    while(i != n){
        e=e*x;
        i++;
    }

    cout << endl << "A hatvany erteke: " << e;
    char c; cin >> c;

	return 0;
}