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 7948223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:39:47+00:00 2026-06-04T01:39:47+00:00

So for two separate code fragments, why does an incrementor/decrementor act differently? Fragment A:

  • 0

So for two separate code fragments, why does an incrementor/decrementor act differently?

Fragment A:

i=7; j=8; k=9; 
printf("%d\n", i - 7 && j++ > k);
printf("%d %d %d", i, j, k);

will produce the following output:

0
7 8 9

Fragment B:

while (i > 0)
printf("T minus %d and counting\n",i--);

produces this:

T minus 5 and counting
T minus 4 and counting
T minus 3 and counting
T minus 2 and counting
T minus 1 and counting

Now, I know that arguments to functions are passed by value, and that it must have something to do with the fact that j is used in a boolean expression. But these two situations seem contradictory to me. What’s going on here?

  • 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-04T01:39:49+00:00Added an answer on June 4, 2026 at 1:39 am

    Okay, you’re going to need to look very closely at how the operators precedences are arranged and exactly how they work. Since this is homework, i’m not going to give the exact answer, but there are two things you should do.

    1. Rewrite tthe expressions with full parentheses using the precedence tables
    2. Look up the exact behavior of &&. In particular, when is the subexpression j++ > k executed?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following JSF code contains two separate <c:if></c:if> . Let's look at it. <?xml
I am fetching two separate variables with time & date as separate values: $v['EventDate']
I have some code where I need two separate required field validators for one
I am writing a driver to act as a wrapper around two separate MySQL
Does anyone know why Google Analytics requires two separate script tags? Specifically, their instructions
This code takes in users and movies from two separate files and computes a
I am attempting to translate two separate algorithms into Java code in order to
I have two separate (but similar) bits of jQuery code. They both work, but
This extension method does not work on two separate development machines: public static string
I have set up some code so that when two separate buttons are tapped

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.