You are not logged in. Please login at www.codechef.com to post your questions!

×

Are L-- and L=L-1 the same?

I assumed L-- and L=l-1 to be the same but in a code that I am trying, I see different results. Any help?

asked 22 Jan, 05:32

zizizi's gravatar image

0★zizizi
52
accept rate: 0%

edited 22 Jan, 05:33


If you use L--, the old value will be used for the calculation and the value of L will be decreased by 1 afterwards. where L-- is the postfix decrementation.

For L = L - 1, the opposite is the case: It will first be decremented and only then the calculation will take place.

link

answered 22 Jan, 08:49

siva140191's gravatar image

3★siva140191
1335
accept rate: 12%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,313

question asked: 22 Jan, 05:32

question was seen: 97 times

last updated: 22 Jan, 08:49