B
BobR
// > #include "stdafx.h" // NOT standardScoots said:oops, had my own logic flaw up there, sorry.
Program worked as expected with:
// test.cpp : Defines the entry point for the console application.
//
#include <iostream>
#define FORWIN// > #include said:#include <cstdlib>
> using namespace std;
#elseint main(){ #ifdef FORWIN
system("cls");
// GNU/Linux or ?
#endif // FORWIN
if( not cin || base == 0.0 ){ /* failure */ /* cin.clear();*/}cout <<"Enter the base:\n"; double base( 0.0 );
cin >> base;
if( not cin || exponent == 0 ){ /* failure */ /* cin.clear();*/}cout <<"Enter the exponent:\n"; int exponent( 0 );
cin >> exponent;
double new_base( base );
for( int i( 0 ); i < exponent-1 ; ++i){ file://changed this!
// > new_base = new_base * base;
new_base *= base;
#else} // for(i)
cout <<"The final powered output is :\n" << new_base; #ifdef FORWIN
system("PAUSE");
// GNU/Linux or ?
#endif // FORWIN