Professional Documents
Culture Documents
CS201 by Abdul Hadi E Services - 3
CS201 by Abdul Hadi E Services - 3
#include <iostream>
using namespace std;
main()
{
cout<<"\tCS201 Assignment 1 Solution" <<endl;
cout<<"\t\t Spring 2021"<<endl;
cout<<"\tby Abdul Hadi E Services \n" <<endl <<endl;
//Solving Expression
int x, y, Z;
x=2, y = 1;
Z= (x*x)+(2*x*y)-(x/y);
cout<<"After evalution of given expression the value of z = "<<Z <<endl;
// Student ID and Anylizing
string ID = "BC" ;
int id2 = 2000201127;
string Name = "Moazzam Ali";
int lastdigit;
int Gotnumber;
///Evaluation of ID
lastdigit = id2 % 10;
cout<<"Last digit of my vu ID is "<<lastdigit <<endl;
Gotnumber = Z + lastdigit;
// IF else Loop
//Adding last digit of ID and Z and print result Odd or Even
string test;
int n = 1;
if ((lastdigit % 2) == 0)
{
test = " even";
cout<<"I got an" <<test <<" number "<<Gotnumber <<endl;
else
{
test = " odd";
cout<<"I got an" <<test <<" number "<<Gotnumber <<endl;