CODE: CPP - Assignment01.Opt1: Assignment Topic Assignment Duration
CODE: CPP - Assignment01.Opt1: Assignment Topic Assignment Duration
Opt1 FRESHER
Assignment topic : Variables and Data Types
ACADEMY
Assignment duration : 180 minutes
- Create a variable named myNum1, assign the value 19 to it and add it to MyNum
int MyNum;
MyNum += myNum1;
- Create two variables named numX and numY, assign the value X to it and add it to MyNum such
that MyNum equal to maximum range of Short Int and assign the value Y to it and add it to
MyNum1 such that MyNum1 equal to minimum range of Short Int. Find X, Y
int numX,numY,sumXY;
numX=numY=X;
sumXY = numX+numY;
MyNum += sumXY;
MyNum = Y;
MyNum1 += MyNum;
Bài 2: Add the correct data type for the following variables:
_int__ myNum = 1;
Bài 3: Tạo file Exercise.cpp: Viết chương trình in ra màn hình console tên, tuổi, điểm tổng kết (float,
double) của bản thân trên mỗi dòng riêng biệt.
#include <iostream>
#include <string>
string yourname;
int main(){
int age;
age=12;
float point;
point = 1.74;
return 0;
}}