Write a C++ program that Accept 5 digits number from the user then display following option. No=12345 Result =15

Write a C++ program that Accept 5 digits no from the user then display following option.

No=12345

Result =15

Output

Enter a 5-digit number: 23575
Result = 22

Write a C++ program with loop that Accept 5 digits no from the user then display following option.

No=12345

Result =15

 

Output

Enter a 5-digit number: 45612
Result = 18