Logical Operators | Practice | GeeksforGeeks

Logical operators are used when we want to check the truth value of certain statements. Logical operators help us in checking multiple statements together for their truthness.
Here we will learn logical operators like AND(&&), OR(||), NOT(!). These operators produce either a true or a false as an output.
Example:
Input:
a = 6
b = 7
Output:1 1 0
Explanation:a && b = 1
a || b = 1
(!a) && (!b) = 0
Your Task: 
Your task is to complete the provided function.
Constraints:
1 <= a, b,<= 100
Video:
YouTubeGeeksforGeeks502K subscribersC++ Programming Language Tutorial | Operators in C / C++ | GeeksforGeeksWatch laterShareCopy linkInfoShoppingTap to unmuteIf playback doesn't begin shortly, try restarting your device.Full screen is unavailable. Learn MoreYou're signed outVideos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer.CancelConfirmMore videosMore videosSwitch cameraShareInclude playlistAn error occurred while retrieving sharing information. Please try again later.Watch on0:000:000:00 / 3:16•Live•<div class="player-unavailable"><h1 class="message">An error occurred.</h1><div class="submessage"><a href="https://www.youtube.com/watch?v=WFy9SFJsAWQ" target="_blank">Try watching this video on www.youtube.com</a>, or enable JavaScript if it is disabled in your browser.</div></div>
0
nraj38853 months ago
https://www.techdark.in
0
nraj38853 months ago
https://www.techdark.in
0
jsannauniv11123 months ago
0
yadavprashant10163 months ago
It's Simple in C++ : 
 
void logicOp(int a, int b)
{cout<<(a && b)<<" “<<(a || b)<< ” "<<(!a) && (!b);
cout<<endl;
}
0
swnkhurana6 months ago
void logicOp(int a, int b){   /*output (a&&b), (a||b), and ((!a)&&(!b))separated by spaces*/    bool x = a&&b;   bool y = a||b;   bool z = (!a) && (!b);   cout<< x <<" "<< y <<" "<< z << endl;}
0
martial9 months ago
martial
https://uploads.disquscdn.c... https://uploads.disquscdn.c...
0
Yogeshwari Harode10 months ago
Yogeshwari Harode
Logical Operators https://github.com/yogeshwa...programs/blob/master/C++/Logical%20Operators.cpp
0
yogeshwari harode11 months ago
yogeshwari harode
Logical Operators (Simplest way)https://github.com/yogeshwa...
+1
SACHIN KUMAR1 year ago
SACHIN KUMAR
void logicOp(int a, int b){    /*output (a&&b), (a||b), and ((!a)&&(!b))separated by spaces*/     cout<< (a && b)<<" ";    cout<< (a||b)<<" ";    cout<<(!a);
    cout<<endl; }="">
0
Saurabh Yadav2 years ago
Saurabh Yadav
why its working when I write endl statement at the end of code.... if i write at the starting its showing error
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
                    want to view the editorial?
 Login to access your submissions. 

Problem


Contest

Reset the IDE using the second button on the top right corner.
Avoid using static/global variables in your code as your code is tested against multiple test cases and these tend to retain their previous values.
Passing the Sample/Custom Test cases does not guarantee the correctness of code. On submission, your code is tested against multiple test cases consisting of all possible corner cases and stress constraints.
You can access the hints to get an idea about what is expected of you as well as the final solution code.
You can view the solutions submitted by other users from the submission tab.