This is my code and i dont know why when i enter let's say x=3 and n=0 it gives 3.
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
printf("==========©©Andrei78©©==========");
printf("=======©All Rights Reserved©====");
printf("===========©05-06-2012©=========");
int count,x,u=1;
float n,y;
printf("Enter the values of x and n : ");
cin>>x>>n;
y = 1;
count = 1;
do
{
y = y*x;
count++;
}
while ( count <= n);
cout<<y;
if(n=0){
cout<<"1";
}
system("PAUSE");
return EXIT_SUCCESS;
}
Comment