0% found this document useful (0 votes)
64 views

CS201P Assignment 1 Solution Spring 2024

Uploaded by

dropd2755
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)
64 views

CS201P Assignment 1 Solution Spring 2024

Uploaded by

dropd2755
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/ 4

GET MORE SOLUTION FILES FROM

VUStudentspk.com
CS201P ASSIGNMENT 1 SOLUTION SPRING 2024

Due Date: 29-Apr-2024


Total Marks: 20

FOR FREE AND PAID ASSIGNMENT WITH YOUR OWN STUDENT ID


WHATSAPP +923162965677

Follow Assignment Submission Instructions


You must submit only a .cpp file on the assignments interface of CS201P from your LMS
account. Assignments submitted in any other format(image, pdf, doc, docx, etc) will be scaled
with zero marks. So, check your solution file format before submission.

GET FREE .CPP FILE FROM VUSTUDENTSPK.COM

CPP CODE SOLUTION:

#include <iostream>
using namespace std;

int sumOfEvenDigits(int num) {


int sum = 0;
while (num > 0) {

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
GET MORE SOLUTION FILES FROM
VUStudentspk.com
int digit = num % 10;
if (digit % 2 == 0 && digit != 0) {
sum += digit;
cout << digit << " ";
}
num /= 10;
}
return sum;
}

int main() {

int StudentID = 123456789;

cout << "Student ID: BC123456789" << endl;


cout << "Digital part of the Student ID: " << StudentID << endl;
cout << "Even Digits: ";

// Calculate the sum of even digits


int evenSum = sumOfEvenDigits(StudentID);

cout << "\nSum of even digits: " << evenSum << endl;

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
GET MORE SOLUTION FILES FROM
VUStudentspk.com
return 0;
}

CODE OUTPUT SCREENSHOT:

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
GET MORE SOLUTION FILES FROM
VUStudentspk.com

REGARD - SARIM
WHATSAPP +923162965677

PLEASE NOTE:
Don't copy-paste the same answer.
Make sure you can make some changes to your solution file before
submitting copy paste solution will be marked zero.
If you found any mistake then correct yourself and inform me.
Before submitting an assignment must check your assignment requirement
file.
If you need some help or question about file and solutions feel free to ask.

FOR FREE ASSIGNMENTS SOLUTIONS VISIT

VUStudentspk.com

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1

You might also like