CS201 MID TERM SOLVED MCQs || PAST PAPERS || GROUP-1 || INTRODUCTION TO PROGRAMMING || VuTech Visit Website For More Solutions www.vutechofficial.blogspot.com …
Visit Website For More Solutions www.vutechofficial.blogspot.com
KINDLY, DON’T COPY PASTE
Question No. 1
Write a C++ program that performs the following tasks:
Use only the provided Student ID: BC123456789 (In case of not using this
ID, marks will be deducted.)
Your program must take the numerical part of the given Student ID
BC123456789 which is 123456789.
Save the numerical part of the given ID in a variable.
Double (Multiply by 2) each digit and print each doubled digit in reverse
order.
Calculate sum of all the doubled digits.
Print the sum on screen.
Your program should use functions to complete the above tasks. You will
define doubleDigits() function which will double of each digit and print,
and sumOfDoubledDigits () function to calculate the sum of the doubled
digits.
cout<<"The given student ID
is : " << studentID << endl;
cout<<"Give Student ID
digital part is : " << numericalPart << endl;
doubleDigits(numericValue);
int sum =
sumOfDoubledDigits(numericValue);
cout<< "Sum of Separated
Doubled Digits :" << sum <<endl;
return 0;
}
KINDLY, DON’T COPY PASTE SUBSCRIBE, SHARE, LIKE AND COMMENTS FOR MORE UPDATES SEND WHATSAPP OR E-MAIL FOR ANY QUERY 0325-6644800 kamranhameedvu@gmail.com Visit Website For More Solutions www.vutechofficial.blogspot.com
We provide Virtual University of Pakistan Study Materials such as Solution of Assignments, GDBs, Mid Term Solved Papers, Final Term Solved Papers, Mid Term Solved MCQs, and Final Term Solved MCQs. We also provide regular Semester Quizzes, Updated Handouts, and Short Questions and Answers. We help you with your research and many other educational-related topics, as far as we know. Furthermore, Share your problem with us and Please feel free to ask any related questions.