Following are the C++ program to the given question:
#include <iostream>//header file
using namespace std;
int findCheckSum(int n)//defining a method findCheckSum that takes integer parameter
{
bool c = false;//defining bool variable
int S= 0,d;//defining integer variable
while(n)//defining while loop that seprates digits
{
d = n%10; // get the digit.
n=n/10; // remove the last digit.
if(c)//use if to check the even position value
{
d=d*2;//multiplying d with 2
while(d)//use if to check digit value
{
S=S+(d%10);//adding value
d=d/10;// remove the last digit.
}
}
else//defining else block
{
S=S+d;// checking the odd position
}
c= c^true;//holding bool value
}
return S;//return S
}
int main() //defining main method
{
cout << findCheckSum(1984);//calling method
}
Output:
22
Program Explanation:
Learn more:
brainly.com/question/14788459