Lab#4
Lab#4
4 DD/MM/YYYY
OPERATORS IN C++
Lab outcomes:
After completing this lab, students will be able to:
Implement the arithmetic operators.
Implement the unary operators.
Implement the relational operators.
Implement the logical operators.
Implement the assignment operators.
Activities:
Activity 3.1: Write a program in C++ that takes two numbers as input and print their sum,
difference, product, and quotient using the arithmetic operators.
Code:
Please write or paste your code snap here.
Output:
Please paste your output screenshot here with your Name and CMS mentioned in it.
Activity 3.2: Write a program in C++ that takes an integer as input and print its square
and cube using the multiplication operator.
Code:
Please write or paste your code snap here.
Output:
Please paste your output screenshot here with your Name and CMS mentioned in it.
Activity 3.3: Write a program in C++ that takes an integer as input and prints its value
after incrementing and decrementing it using the unary operators.
Code:
Please write or paste your code snap here.
Output:
Please paste your output screenshot here with your Name and CMS mentioned in it.
Activity 3.4: Write a program in C++ that takes two numbers as input and prints whether
the first number is greater than, less than, or equal to the second number using the
relational operators.
Code:
Please write or paste your code snap here.
Output:
Please paste your output screenshot here with your Name and CMS mentioned in it.
Activity 3.5: Write a program in C++ that takes a character as input and print whether it is
a vowel or a consonant using the logical operators.
Code:
Please write or paste your code snap here.
Output:
Please paste your output screenshot here with your Name and CMS mentioned in it.
Activity 3.6: Write a program in C++ that takes an integer as input and compute its
factorial using the multiplication and assignment operators.
Code:
Please write or paste your code snap here.
Output:
Please paste your output screenshot here with your Name and CMS mentioned in it.
Observations:
Please write your observation after conducting this lab, you have to write in few lines, what did
you learn in this lab.
Rubrics
Absent Student is Student can Student has Student has Student
unable to understand followed constructed perfectly
follow the the provided instructions the implemented
provided laboratory to construct functional/ a working
instructions instructions the working model/
properly. and familiar fundamental schematic/ logic/
The student with the lab schematic/ model/ circuit/
can name environment block block block
the (Trainer/ diagram/ diagram/ diagram/
hardware or software/ code/ model code, and code and
Demonstration simulation IDE), but on the have successfully
platform, cannot protoboard/ successfully executed the
but unable implement trainer/ executed lab objective
to on the simulation the in Realtime
implement platform software. program/ or in a
anything practically run circuit simulation
practically or on the on software environment
or on the software platform and
software produced the
desired
results
Category Ungrade Very Poor Poor Fair Good Excellent
d
Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]
Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0
Date Total Instructor’s Signature
Marks