Question about boolean operators

Terpinator

Reputable
Apr 12, 2017
84
2
4,565
Hello all, I didn't see a programming section so I apologize if this is in the incorrect section. I recently began pursuing a degree in IT and am getting a head start on C programming. I had a quick and basic question.

I am reading about boolean operators. I understand how they work in the sense of what will evaluate to true and false when using them. But I was wondering if someone could give me a couple of basic examples of how they are used. I struggle to understand things unless I can practically apply them.
 
Solution
Hi, Example: you have a large list of students with their age and marks for the last semester and you want to find the student that is 20 years old and has a certain mark, for awarding him a prize.
You'd use AND
If a (standing for age) =20 AND m (standing for mark)=A, THEN print the student name.
It's just an example, but you can us AND, OR, NOT in various similar cases.
Hi, Example: you have a large list of students with their age and marks for the last semester and you want to find the student that is 20 years old and has a certain mark, for awarding him a prize.
You'd use AND
If a (standing for age) =20 AND m (standing for mark)=A, THEN print the student name.
It's just an example, but you can us AND, OR, NOT in various similar cases.
 
Solution

TRENDING THREADS