Lua - Demonstrate the basic example of logical operators Code Example

The code for Demonstrate the basic example of logical operators

print(10 or 20)
print(10 or error)
print(nil or "a")
print(nil and 10)
print(false and error())
print(false and nil)
print(false or nil)
print(10 and 20)

--[[
Output:
10
10a
nil
false
false
nil
20
--]]
Code by IncludeHelp, on August 25, 2022 22:45

Comments and Discussions!





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.