Skip to main content
deleted 1 characters in body
Source Link

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;. However, I wouldn't have come up with it if I hadn't seen other answers to 3.2.1

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;. However, I wouldn't have come up with it if I hadn't seen other answers to 3.2.1

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n =-20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;. However, I wouldn't have come up with it if I hadn't seen other answers to 3.2.1

added 82 characters in body
Source Link

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;. However, I wouldn't have come up with it if I hadn't seen other answers to 3.2.1

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;. However, I wouldn't have come up with it if I hadn't seen other answers to 3.2.1

Post Undeleted by Dissident penguin
Post Deleted by Dissident penguin
Post Undeleted by Dissident penguin
Post Deleted by Dissident penguin
added 28 characters in body
Source Link

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs., same as with int n = 20L;

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs.

3.1

  1. Change i-- to n--
  2. i<n to -i<n
  3. (Unfortunately invalid answer because I wasn't checking with compiler before seeing other answers)

3.2.1

int n = 20 

to

uint n = 20

(Compiler dependent...)

3.2.2

int n = -20L;

for(i = -1; i%n; i--)

prints 19 + signs, same as with int n = 20L;

deleted 217 characters in body
Source Link
Loading
deleted 78 characters in body
Source Link
Loading
deleted 78 characters in body
Source Link
Loading
Source Link
Loading