Leap year Program using logical operators – Part 2

Leap Year Program Using Logical Operator Part 2

The part 1 shows how we were wrong to put the logic wrongly. Here is the program with correct code

What is important in this code is importance of brackets besides logical AND and logical OR operators.

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc.

cenglishcppengcmarathi

Leap Year Program using logical operators Part 1

Leap year program using logical operators – Part 1

We have been encountering Leap year since our school days. So how C can abstain from taking same example to teach basic concepts of decision control structures in it…? See the first part of sample program…

It is not the leap year which is just divisible by 4, as used to teach in school days…its more than that…

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc.

udemy_c_marathi

Logical NOT (!) operator in C

Logical ! (NOT) operator in C

“माझ तुझ्यावर प्रेम नाही असं नाही…!” काय अर्थ आहे हो या वाक्याचाheart

समजायला सोपा पण वापरायला अवघड असा हा logical operator. पण अवघड म्हणजे syntax अवघड नाही तर कोणत्या situation ला नेमका त्याचा वापर करायचा ती ओळखणे अवघड. पहा आम्ही logical NOT operator कसा समजावून सांगीतलाय ते…

Unlike other 2 logical operators i.e. Logical && (AND) and Logical || (OR), this is unary operator. It turns true to false and false to true…!

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc. please register for Discount Coupon

cenglishcppengcmarathi

Logical OR (||) operator in C

Logical || (OR) operator in C

दोन किंवा दोन पेक्षा जास्त कंडीशंन्स चेक करायच्या असतील आणी त्या पैकी फक्त एक जरी True होत असेल तर पुर्ण condition True असे हवे असेल तर logical || (OR) operator वापरण्याची सोय डेनीसनं करून ठेवली आहे.

Here if two or multiple conditions are tested using logical OR operator then the whole condition is false only when all conditions are false. In rest of the cases the final condition will be true…

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc.

cenglishcppengcmarathi

Logical AND (&&) operator

Logical && (AND) operator in C

एका पेक्षा अनेक कंडीशंन्स टेस्ट करायच्या असतील तर आपण नेस्टींग वापरतो. पण नेस्टींग सुद्धा काहीवेळा complex होत जाते. यावरच एक उत्तम उपाय म्हणजे logical operators चा योग्य ठिकाणी वापर. 

When two are more than 2 conditions are to be tested then logical AND operator gives you truth value when all conditions are true. In rest of the cases it would return 0 i.e. FALSE

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc.

cenglishcppengcmarathi