0% found this document useful (0 votes)
15 views2 pages

Cs 201

Uploaded by

hifsaaslam111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Cs 201

Uploaded by

hifsaaslam111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<iostream>

using namespace std;

void doubleDigits(int num)

int doubleDigit=0;

int reversedSum =0;

int digit=0;

while (num > 0)

digit =num % 10;

doubleDigit = digit * 2;

cout<<"Seperated digits doubled : "<<doubleDigit << "\n";

reversedSum = (reversedSum *10) + doubleDigit;

num /= 10;

int sumOfDobledDigit(int num)

int sum =0;

while (num> 0)

int digit = num % 10;

int doubledDigit = digit * 2;

num /= 10;
}

return sum;

num /= 10;

int main()

cout<<"THe given Student ID is: BC220419706"<<endl;

cout<<"Give Student id digital part is : 220419706"<<endl;

int numericalPart = 220419706;

doubleDigits(numericalPart);

cout << "Sum of Separated Doubled Digits: " <<endl;

return 0;

You might also like