Multiply a number by a power

// Multiply a number by a power.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
       int number, power, count, i;
       cout << "Enter Number:";
       cin >> number;
       cout << "Enter Power";
       cin >> power;
       count = 1;
       for (i = 1; i <= power; i++)
             count = count * number;
       cout << "The result is: " << count << endl;
       system("pause");
       return 0;
}



Share on Google Plus