alright, i'm just learning c++
and i've put a code in to find the square of a number
this is the code i used;
#include<iostream>
void main()
{
char cReply;
int iNum, iSquare;
std::cout << "Do you want to find the square of a number (y/n)?";
std::cin >> cReply;
while(cReply == 'y')
{
std::cout << "Enter a number:";
std::cin >> iNum;
iSquare = iNum * iNum;
std::cout << "The square of "<<iNum<<"is"<<iSquare<<std::endl;
std::cout << "Do you want to find the square of another number (y/n)?";
std::cin >> cReply;
}
}
but it fails everytime
help?