Code:
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
int main ()
{
int i;
char n [20];
cout<<"Input: ";
cin.getline (n,20,'\n');
i = atoi (n);
cout<<"Value entered is "<<n<<"and its square is "<<(n[256])*(n[256]);
return 0;
}
I have done this for an integer first. i can get it to cout what i have written but i dont know how to code it to give me a result. I know wat has to be done, like it should keep on writting integers until it gets to a + or - sign then it should calculate but i dont know how to code this one.. PLEASE HELP .