What is wrong with this program code? I need help.
using namespace std;
int main () {
string g;
int count;
cout << "Enter a num\n";
cin >> g;
count = g.size() - 1; // length of number - 1
cout << g[0] << " is " << count << " digits from the right";
return 0;
Last edited on
You have forgotten the closing curly bracket }
at the end of main()
also.