0% found this document useful (0 votes)
7 views4 pages

PF Lab A2

jao rakh lo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

PF Lab A2

jao rakh lo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment #2

[FP Lab]
C++ PROGRAMS
Submitted by: Tahira Inam
(Roll No: 105)
Instructor: Maham Sajid

1st Semester (Blue)

Department of Software Engineering


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:

Condition 1 Condition 2 Result

True true true

True false true

False true true

False false false

You might also like