Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8363221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:07:32+00:00 2026-06-09T12:07:32+00:00

This: if (A || B) { X; } if (C && D) { X;

  • 0

This:

if (A || B) { X; }
if (C && D) { X; }
if (F != G && H + I === J) { X; }

Can be replaced by:

if ((A || B) || (C && D) || (F != G && H + I === J)) { X; }

But can it be replaced by:

if (A || B || C && D || F != G && H + I === J) { X; }

? (Without parentheses)

And is there any difference between languages?

P.S: The answers shouldn’t based on those examples.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:07:32+00:00Added an answer on June 9, 2026 at 12:07 pm

    One, this is all invalid if these have side-effects.

    Two, only if X is idempotent, which is a fancy way of saying, if X can be called twice with no change on the second time.

    http://en.cppreference.com/w/cpp/language/operator_precedence

    && binds tigther than ||, so yes, you may drop parens around && in this context. The operator precedence rules I believe hold valid for any language that has them, I don’t know any counterexamples to this, and the languages you asked about do follow C operator precedence rules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i convert this $langClarContent = > &# 1059.,&#1095.,&#1080.,&# 1090.,&# 1077.,&# 1083.,Dokeos &#
How can I convert this to preg_match? $urlregex = (https?|ftp)://([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&;%$-]+)*@)*((?:(25[0-5]|2[0-4]\d|[01]\d{2}|[1-9]\d|[1-9])\.){3}(25[0-5]|2[0-4]\d|[01]\d{2}|[1-9]\d|[1-9]|0)|localhost|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:\d+)*(($|[a-zA-Z0-9.,?'+\\&;%\$#=~_-]+))*; if (!eregi($urlregex, $_POST['url'])) {
How can I do this on Ruby? puts some_method(ò) # => ò In other
How can I do a Redirect Rule that transforms this URL: http://localhost/app/Company/HomePage.aspx?COMPANYID=2&FORCESHOWCASE=TRUE&THEMEPREVIEW=3 to this
I'm having this url parameter: http://127.0.0.1:8000/information/vimeo/?oauth_token=xxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxx How can I get the value of oauth_verifier
I have a td-element which can contain some HTML code, e.g. < . This
From this question & the answers - What is the correct answer for cout
For Eg : Follow @SoccerBible, RT this & if Ronaldo scores https://bit.ly/133/com tonight we'll
Spreadsheet Sheet3 looks like this: S&P 500 DJIA 1/1/1991 795.4476 2973.09 1/2/1991 786.3856 2947.1
In a C++ function like this: int& getNumber(); what does the & mean? Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.