University of Sialkot Submission date: January 11, 2024 1. C++ program to print student's Grades according to obtained marks using if-else-if statement
Code snippets: Console view:
2. Difference between ‘&&’ (AND) and ‘||’ (OR)
operators The symbols “&&” and “||” are logical operators commonly used in programming languages to perform logical operations. The ‘&&’ Operator: The “&&” operator, often referred to as the “logical AND” operator, is used to combine two or more conditions. It returns true if both conditions evaluate to true, and false otherwise.
The truth table for the “&&” operator:
Condition 1 Condition 2 Result
True true true
True false false
False true false
False false false
The ‘||’ Operator:
The “||” operator, known as the “logical OR” operator, is used to combine conditions. It returns true if at least one of the conditions evaluates to true, and false only if both conditions are false.The truth table for the “||” operator: