Problem Code FLOW004

This is my Code:

using namespace std;

int main()
int number,first,last,sum;

//cout << "Enter a Number:";
cin >> number;

first = number % 10;

while(number != 0)
    last = number % 10;
    number = number / 10;

sum = first + last;
//cout << "Sum of First and Last Digit of Given Number is : " << sum;
cout << sum;

return 0;


What is wrong with this??

Just because of you printed “Enter a Number:” and "Sum of First and Last Digit of Given Number is :"
You just need to print expected output nothing else

1 Like

Did the Changes didnt work out
Still shows wrong answer

Could you provide problem link?

@admin5 check yogi_'s profile, they got AC on this problem almost immediately after the comment response.

1 Like

The “\n” character is missing after your cout statement. Therefore all output will be on the same line and the judge won’t accept it as correct answer.