[Question]
  [
Anybody can make the output of a program bigger by adding characters, so let's do the exact opposite.
Write a full program, an *inner* function or a snippet for a REPL environment in a language of your choice that satisfies the following criteria:
1. Your code must be at least 1 character long.
2. Running the original code produces **x** characters of output to STDOUT (or closest alternative), where **0 ≤ x < +∞**.
3. Removing *any arbitrary single character* from the original code results again in valid code, which produces at least **x + 1** characters of output to STDOUT.
4. Neither the original code nor the modifications may produce any error output, be to STDOUT, STDERR, syslog or elsewhere. The only exceptions to this rule are compiler warnings.
Your program may not require any flags or settings to suppress the error output.
Your program may not contain any fatal errors, even if they don't produce any output.
5. Both the original code and the modifications must be deterministic and finish eventually (no infinite loops).
6. Neither the original code nor the modifications may require input of any kind.
7. Functions or snippets may not maintain any state between executions.
Considering that this task is trivial is some languages and downright impossible in others, this is a [popularity-contest](/questions/tagged/popularity-contest "show questions tagged 'popularity-contest'").
When voting, please take the "relative shortness" of the code into account, i.e., a shorter answer should be considered more creative than a longer answer *in the same language*.
  
[Answer]
# Any REPL with caret XOR operation, 5 bytes
```
11^11
```
`11^11` is of course 0. The only other possibilities are `1^11` or `11^1` which are 10, or `1111` which produces itself.
[Answer]
# TI-BASIC, ~~3~~ 1
```
"
```
When the last line of a program is an expression, the calculator will display that expression. Otherwise, the calculator displays `Done` when the program finishes. The expression here is the empty string, but it could also work with any one-digit number.
### 2 bytes:
```
isClockOn
```
Same as the above but with a 2-byte token.
### 3 bytes:
```
ππ⁻¹
```
Prints `1` due to implied multiplication. Can be extended indefinitely by adding pairs of `⁻¹`'s. The below also work.
```
√(25
e^(πi
⁻ii
ii³
2ππ   
cos(2π
```
### Longer solutions:
```
11/77►Frac
ᴇ⁻⁻44
cos(208341   //numerator of a convergent to pi; prints "-1"
```
There are probably also multi-line solutions but I can't find any.
[Answer]
# CJam, JavaScript, Python, etc, 18 bytes
```
8.8888888888888888
```
The outputs in CJam are:
```
8.8888888888888888 -> 8.88888888888889
8.888888888888888  -> 8.888888888888888
88888888888888888  -> 88888888888888888
.8888888888888888  -> 0.8888888888888888
```
JavaScript and Python work in similar ways. It isn't competitive in JavaScript and Python, but it's not easy to find a shorter one in CJam.
[Answer]
# Octave, 5 bytes
```
10:10
```
(x : y) gives the array of numbers between x and y in increments of 1, so between 10 and 10 the only element is 10:
```
> 10:10
ans = 10
```
When the second argument is less than the first, octave prints the empty matrix and its dimensions:
```
> 10:1
ans = [](1x0)
> 10:0
ans = [](1x0)
```
When a character is removed from the first number, there are more elements in the array:
```
> 1:10
ans = 1 2 3 4 5 6 7 8 9 10
> 0:10
ans = 0 1 2 3 4 5 6 7 8 9 10
```
When the colon is removed, the number returns itself:
```
> 1010
ans = 1010
```
[Answer]
# Microscript, 1 byte
```
h
```
This produces no ouput, as `h` suppresses the language's implicit printing. Removing the sole character produces a program whose output is `0\n`. 
~~I'll try to come up with a better answer later.~~
**EDIT ON NOVEMBER 17:**
This also works in Microscript II, with the exception that, instead of yielding `0\n`, the empty program yields `null`.
[Answer]
# Pyth, 3 bytes
```
cGG
```
`G` is preinitialized with the lowercase letters in the alphabet. `c` is the split-function. 
`cGG` splits the alphabet by occurrences of the alphabet, which ends in `['', '']` (8 bytes). 
When the second parameter is missing, `c` splits the string by whitespaces, tabs or newlines. Since none of them appear in `G`, the output for `cG` is `['abcdefghijklmnopqrstuvwxyz']` (30 bytes). 
And `GG` simply prints twice the alphabet on two seperate lines: `abcdefghijklmnopqrstuvwxyz\nabcdefghijklmnopqrstuvwxyz` (53 bytes). 
Try it online: [Demonstration](https://pyth.herokuapp.com/?code=cGG&debug=0)
[Answer]
# Python REPL, 6 bytes
Not the shortest, but here's another floating point abuse answer:
```
>>> 1e308
1e+308
>>> 11308
11308
>>> 11e08
1100000000.0
>>> 11e38
1.1e+39
>>> 11e30
1.1e+31
```
But...
```
>>> 11e308
inf
```
[Answer]
**JavaScript (and a lot more), 5byte**
`44/44` or 
```
44/44 -> 1
44/4  -> 11
4444  -> 4444
4/44  -> 0.09090909090909091
```
[Answer]
# CJam, 5
```
''''=
```
[Try it online](http://cjam.aditsu.net/#code=''''%3D)
```
''''=   compares two apostrophes and prints 1
'''=    prints '=
''''    prints ''
```
[Answer]
# [Lenguage](http://esolangs.org/wiki/Lenguage), 5 bytes
```
00000
```
The length of the program is 5 which corresponds to the brainf\*\*\* program `,` reading an end of input character and terminating without output.
Removing any char results in the code `0000` which has a length of 4 corresponding to the brainf\*\*\* program `.` printing out one character (codepoint `0`) and terminating.
The [Unary](http://esolangs.org/wiki/Unary) equivalent would be `0000000000000` (13 zeros) because you have to prepend a leading `1` to the binary length of the code so `101` becomes `1101`.
[Answer]
# PHP, 6 bytes
I have been watching this group for a couple of weeks and am amazed of your programming techniques. Now I had to sign in, there is something I can do, sorry :-) However, this might be my last post here...
```
<?php 
```
(note the space after second `p`)
This outputs empty string. Removing any character outputs the text without the character. Note it can produce HTML errors (content not rendered by browsers for eg. `<?ph`).
I also tried with the `echo` tag. ie. eg.:
```
<?= __LINE__;;
```
This one outputs `1`. If `=` is omitted, `<? __LINE__;;` is the output. However, removing any of the magic constant character will result in *E\_NOTICE*: Notice: Use of undefined constant **LNE** - assumed '**LNE**' in...
If *notices* are not considered *errors* (point 4 of rules), this also applies :-)
[Answer]
# Python, 10 8 bytes
```
256**.25
```
Works in Python and friends.
Thanks to Jakube for showing how to make it 2 bytes smaller.
From IDLE:
```
>>> 256**.25
4.0
>>> 26**.25
2.2581008643532257
>>> 56**.25
2.7355647997347607
>>> 25**.25
2.23606797749979
>>> 256*.25
64.0
>>> 256*.25
64.0
>>> 256**25
1606938044258990275541962092341162602522202993782792835301376L
>>> 256**.5
16.0
>>> 256**.2
3.0314331330207964
```
originally I had this (10 bytes):
```
14641**.25
```
From IDLE:
```
>>> 14641**.25
11.0
>>> 4641**.25
8.253780062553423
>>> 1641**.25
6.364688382085818
>>> 1441**.25
6.161209766937384
>>> 1461**.25
6.18247763499657
>>> 1464**.25
6.185648950548194
>>> 14641*.25
3660.25
>>> 14641*.25
3660.25
>>> 14641**25
137806123398222701841183371720896367762643312000384664331464775521549852095523076769401159497458526446001L
>>> 14641**.5
121.0
>>> 14641**.2
6.809483127522302
```
and on the same note:
```
121**.25*121**.25
```
works identically due to nice rounding by Python, in 17 bytes.
```
>>> 121**.25*121**.25
11.0
>>> 21**.25*121**.25
7.099882579628641
>>> 11**.25*121**.25
6.0401053545372365
>>> 12**.25*121**.25
6.172934291446435
>>> 121*.25*121**.25
100.32789990825084
>>> 121*.25*121**.25
100.32789990825084
>>> 121**25*121**.25
3.8934141282176105e+52
>>> 121**.5*121**.25
36.4828726939094
>>> 121**.2*121**.25
8.654727864164496
>>> 121**.25121**.25
29.821567222277217
>>> 121**.25*21**.25
7.099882579628641
>>> 121**.25*11**.25
6.0401053545372365
>>> 121**.25*12**.25
6.172934291446435
>>> 121**.25*121*.25
100.32789990825084
>>> 121**.25*121*.25
100.32789990825084
>>> 121**.25*121**25
3.8934141282176105e+52
>>> 121**.25*121**.5
36.4828726939094
>>> 121**.25*121**.2
8.654727864164496
```
[Answer]
# SWI-Prolog interpreter
```
__A=__A.
```
**Note: You cannot remove the final `.`**. Prolog interpreters will always look for a final period to run your query, so if we stick strictly to the rules of this contest and allow ourselves to remove the period it won't run, it will jump a line and wait for additional commands until one is ended by a period.
The original query `__A=__A.` outputs `true.`.
The query `_A=__A.` outputs `_A = '$VAR'('__A')`. Similar modifications (i.e. removing one `_` or one of the two `A`) will result in similar outputs.
Finally, the query `__A__A.` outputs in SWI-Prolog:
```
% ... 1,000,000 ............ 10,000,000 years later
% 
%       >> 42 << (last release gives the question)
```
[Answer]
# Sed, 1 byte
```
d
```
As `sed` requires an input stream, I'll propose a convention that the program itself should be supplied as input.
```
$ sed -e 'd' <<<'d' | wc -c
0
$ sed -e '' <<<'d' | wc -c
2
```
An alternative program is `x`, but that only changes from `1` to `2` bytes of output when deleted.
[Answer]
# K, 3 bytes
```
2!2
```
Outputs `0` in the REPL. Removing the first 2 outputs `0 1`, removing the exclamation results in `22`, and removing the last 2 results in a string that varies between K implementations but is always at least 2 characters (in oK, it's `(2!)`; according to @Dennis, Kona outputs `2!`).
[Answer]
# MATLAB, ~~9~~ 7 bytes
It's 2 bytes longer than the other MATLAB/Octave answer, but I like it nonetheless, as it's a bit more complex.
Matlab's `'` operator is the complex conjugated transpose. Using this on a scalar imaginary number, you get `i' = -i`. As imaginary numbers can be written simply as `2i` one can do:
```
2i--2i'
ans =
     0    
```
Removing any one of the characters will result in one of the below:
```
ans =
   0.0000 - 1.0000i
   2.0000 - 2.0000i
   0.0000 + 4.0000i
   0.0000 + 4.0000i
   0.0000 + 1.0000i
   2.0000 + 2.0000i
   0.0000 + 4.0000i
```
[Answer]
# GolfScript, 2 bytes
This answer is non-competing, but since it is the piece of code that inspired this challenge, I wanted to share it anyway.
```
:n
```
By default, all GolfScript programs print the entire stack, followed by a linefeed, by executing `puts` on the entire stack. The function `puts` itself is implemented as `{print n print}` in the interpreter, where `print` is an actual built-in and `n` is a variable that holds the string `"\n"` by default.
Now, a GolfScript program always pushes the input from STDIN on the stack. In this case, since there isn't any input, an empty string is pushed. The variable assignment `:n` saves that empty string in `n`, suppressing the implicit linefeed and making the output completely empty.
By eliminating `n`, you're left with the incomplete variable assignment `:` (you'd think that's a syntax error, but nope), so the implicit linefeed is printed as usual.
By eliminating `:`, you're left with `n`, which pushes a linefeed on the stack, so the program prints two linefeeds.
[Answer]
# J, 5 bytes
```
|5j12
```
Magnitude of the complex number `5 + 12i` in REPL.
```
   |5j12 NB. original, magnitude of the complex number `5 + 12i`
13
   5j12  NB. the complex number `5 + 12i`
5j12
   |j12  NB. magnitude of the undefined function j12
| j12
   |512  NB. magnitude of 512
512
   |5j2  NB. magnitude of 5 + 2i
5.38516
   |5j1  NB. magnitude of 5 + 1i
5.09902
```
.
# J, 9 bytes
```
%0.333333
```
Based on floating point precision, reciprocal and matrix inverse.
```
   %0.333333 NB. original, reciprocal of 0.333333
3
   0.333333  NB. 0.333333
0.333333
   %.333333  NB. matrix inverse of 333333
3e_6
   %0333333  NB. reciprocal of 333333
3e_6
   %0.33333  NB. reciprocal of 0.33333
3.00003
```
[Try it online here.](http://tryj.tk/)
[Answer]
# APL, J and possibly other variants, 3 bytes
```
--1
```
It outputs `1` in APL. `-1` outputs `¯1`, and `--` outputs the following in [TryAPL](http://tryapl.org/):
```
┌┴┐
- -
```
[Answer]
# Mathematica, 3 bytes
```
4!0
```
---
```
4!0  ->  0    the factorial of 4, times 0
4!   ->  24   the factorial of 4
40   ->  40
!0   ->  !0   the logical not of 0, but 0 is not a boolean value
```
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM), 2 bytes
`⍴0` returns an empty string (length 0)
`⍴` returns `⍴` (length 1)
`0` returns `0` (length 1)
[Answer]
# Swift (and a lot more), 8 bytes
```
93^99<84
```
output (4 chars):
```
true
```
When removing the nth character the output is:
```
n -> out
----------
0 -> false
1 -> false
2 -> false
3 -> false
4 -> false
5 -> 10077
6 -> false
7 -> false
```
There are 78 possible solutions like this in the format of `a^b<c`.
I think the goal of this challenge should be as many bytes as possible, because the more bytes, the more possible bytes to remove and therefore more difficult.
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), 2 bytes
```
♂(
```
[Try it online!](https://tio.run/##y00syUjPz0n7///RzCaN//8B "MathGolf – Try It Online")
## Explanation
```
♂   Push 10
 (  Decrement TOS by 1
```
## Why does this work?
The regular output is `9`. If the `(` is removed, the output is 10. If the `♂` is removed, the program implicitly pops a 0 from the stack to feed the `(` operator, which outputs `-1`.
[Answer]
# 05AB1E (legacy), 1 [byte](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
Any single byte in 05AB1E (legacy) would work, except for `[` (infinite loop).
[See here all possible outputs for all possible single-byte 05AB1E programs.](https://tio.run/##RcjpUpJhGIfxU6G3hRYzrWwv2vd9sWVo0bI9yxaLyubhFREtW4AKFYhFUZSUfQdn7j8vzeTMM3QK94kQn@rb9bta2jo6W7vqdeWX57ddxmRcJmRSpmRaZmTW2F2L17K1Yq30R5UO6ZQumZNBGeYhH9uG2TbCNi@rZlZVVvtZtbA6wKpVt8S4dNnyFfqVq1avaVrbvK6ldf2GjW2bNm/Zum37jp27DLv37N23/8DBQ4ePHD12/MTJU6fPnD13/kL7xUuXrxivXrt@o6Pz5q2u23fu3rv/4OGj7sdPnj57/qL35SvT6zdv@95VU6xG5DiLsaqdhZdFiIWPhX/RyiKqNSqn2StWrVRNVwQLF4tRFm4WHhYBFg4WzkU3WwKan0Vec1QGtbKWrZjJTwEK0gRNUoimaJrCNEOzFJEFmqN5ilKM4pSgJKUoTRnKUo7yVKAilahMCxAwQ0U/LBiAFYOwYQjDeI8PGMFHfMJnfIEdDjjxFd/wHS6MYgzjcMMDL37ABz8CCGICkwhhCtMIYwaziOAn5jCPKGKII4EkUkgjgyxyyKOAIkooY0HpNRkUHVvtOsVgam5vorShT6/8W3ql8fQ9/93TcL3@Fw)
Removing that single byte so an empty program remains will output the content of info.txt to STDOUT instead by default.
[Try it online.](https://tio.run/##MzBNTDJM/Q8EAA)
---
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 1 [byte](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
?
```
[Try it online.](https://tio.run/##yy9OTMpM/f/f/v9/AA)
Unfortunately an empty program in the new version of 05AB1E only outputs a 1-byte newline by default ([Try it online](https://tio.run/##yy9OTMpM/Q8EAA)), so almost none of the 1-byte characters are possible since they'll have to output nothing. The only possible program that outputs nothing (so also not the implicit newline) is `?` as far as I know.
[Answer]
# Clojure, 11 bytes
```
(defn x[]1)
```
At first I thought to just post a single character answer in the REPL like the other languages, e.g.
```
user=> 1
1
```
But the problem is that if you remove that character, the REPL doesn't do anything upon the enter keypress. So instead it had to be wrapped with a function as permitted by the question's rules. When you call this function, it returns 1. If you remove the only character in the function,
```
(defn x[])
```
the function returns `nil` which prints an additional two bytes.
```
user=> (defn x[]1)
#'user/x
user=> (x)
1
user=> (defn y[])
#'user/y
user=> (y)
nil
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 2 bytes
```
AÉ
```
[Try it online!](https://tio.run/##y0osKPn/3/Fw5///AA "Japt – Try It Online")
`A` is pre-initialized to 10, `É` subtracts 1, and the result is 1 byte: `9`.
[Removing É](https://tio.run/##y0osKPn/3/H/fwA "Japt – Try It Online") results in the program `A`, which outputs A's value, `10`, so the result is 2 bytes.
Similarly, [removing A](https://tio.run/##y0osKPn//3Dn//8A) results in just `É` which is interpreted as -1 and output as `-1`, so the result is 2 bytes.
[Answer]
# [Runic Enchantments](https://github.com/Draco18s/RunicEnchantments/tree/Console), 6 (modifiable) bytes
```
11-{{B\
/B~~@/
\00<
R"Error"@
```
[Try it online!](https://tio.run/##KyrNy0z@/9/QULe62imGS9@prs5BnyvGwMCGK0jJtagov0jJ4f9/AA "Runic Enchantments – Try It Online")
Runic does not have a REPL environment and writing a full program to satisfy the constraints is not readily feasible (leading to either invalid programs or no output). So the portion of the code `11-{{B` is acting as an *inner function* and only this portion can be modified. The `B` instruction is close enough to a function pointer and return statement that this classification should be acceptable (as it jumps the IP to a position in the code as well as pushing a return location to the stack which may be accessed by a subsequent `B` or discarded).
* Standard output: `0`
* Removing either of the `1`s: `05`
* Removing the `-`: `11`
* Removing either `{`: `Error051`
* Removing the `B`: `120`
The final `\` on the end of the first line provides an external boundary around the inner function in the event that the return instruction is removed so that the IP doesn't go meandering all over everywhere willy nilly (and print no output).
Note that `Error051` is just an arbitrary string, I could put anything I wanted into that portion of the code and "Error" was an amusing result for having code that feks up the return coordinates and the IP teleports to an arbitrary location.
]