text:
Print your char count in words, in many languages
This challenge is inspired by my earlier challenge "Create a program that prints the amount of characters it has, in words".
This challenge's rules are simple: make a program that prints its character count, in words, which works in as many languages as possible.
Each programming language the program works in must make the program print its char count in a different natural language.
E.g. you can make a polyglot which prints "fifty" (suppose this is its char count) in one language and "pedeset" (Serbocroatian for 50) in another, but not a polyglot printing "fifty" in both languages.
An extension to the "don't invent languages to solve the task" rule also applies here: don't make a constructed language just to validate your otherwise nonsense output in some language.
If the polyglot printing "fifty" in one language was tested in another and printed (prant?) "Aijsisdjdsl", it's illegal to make a conlang using "Aijsisdjdsl" as the word for "fifty".
Capitalization is ignored: in case you're printing "one" (somehow) you can print "one", "oNe", "ONE" or anything else.
Base ten is required.
Proper spacing is also required.
In the (unlikely but just for specification) case your program reaches one billion characters or more, use the American number scale. A billion here is 10^9 and a million is 10^6.
Do not use "one hundred and one": use "one hundred one".
Do not use the hyphen. Print forty four, not forty-four.
If the language you use has another script, use it instead of the romanization of it. If your program prints Arabic in some language, it should print (yet again, example with 50) "خمسون" and not "khamsun".
Use the grammatically correct translation.
For our purposes, we use Ethnologue to determine what is and isn't a language in this challenge. It's the most widely used so we'll just go with that.
For simplicity, any languages with identical numerals will be considered the same for this challenge. Using any Japanese/Chinese numeral gives you a score of 1.
If a word is spelled the same in multiple languages, e.g. English and French's "six", it counts as one point toward your score.
Dialects Ethnologue differentiates will be considered different languages as long as they don't fall in the two rules above.
Different compilers of the same programming languages are not differentiated here.
Your score is the amount of languages your program works in, per standard rosetta-stone rules.
If the two (or more) best answers are tying, the one with the lowest byte count wins.
The encoding used to determine byte count for tiebreakers is UTF-8.
The highest score wins (in case of tie see above). Have fun.

Do the same rules apply as in your previous challenge regarding output, or are we allowed to choose which format to output in this time? So is it mandatory to output hundred thirty four instead of one hundred and thirty-four, or are both allowed? And does this also apply to other languages (i.e. in Dutch: honderd dertig vier - which literally translates as the three words hundred thirty four, instead of honderdvierendertig - which would be the grammatically correct translation for one hundred and thirty-four)? I would allow both variations, or else the grammatically correct one.

It might also be a good idea to link to your previous challenge, and copy some of its rules to here, since challenges should be self-contained.

I only notice this now, but what is the win condition of the challenge? I don't see a code-challenge tag, nor any indication on the scoring? Reading the challenge I assumed the more languages the better the score, and byte-count if the amount of languages are equal (since that's usually the case), but I don't see this in the challenge description.. Right now this would be closed as "doesn't have a clear winning condition"..

If a number is spelled the same in multiple languages, is that considered different for this challenge? For example, "six" in English and French.

In case anyone's interested, 100 is "백" in Korean, "百" in Chinese, "ひゃく" in Japanese(Hiragana, because Kanji is all the same in CJK). 1000 is "천" in Korean, "千" in Chinese, "せん" in Japanese.

[tag:rosetta-stone] is not a scoring criterion, though it feels like it should be. Please use [tag:code-challenge]

Can we output trailing whitespace?

Is it generally accepted that different C compilers are different languages for polyglotting?

Do dialects count as separate natural languages? (I am not referring to programming languages in this case.)

Here's the rule in short: if Ethnologue says it's separate, then it's a separate language, unless the two languages use the same numerals system. If two separate numbers have at least one number spelled the same and you are using it, one point to you.

9 10 12 13 16 18 21 23 languages, 1000 bytes

Bash (prints "duizend", Dutch)
Zsh (prints "een Dausend", Luxembourgish)
Dash (and other true POSIX shells) (prints "nje mije", Albanian)
C (prints "et tusind", Danish)
C++ (prints "ib txhiab", Hmong)
brainfuck (prints "mille", Italian)
boolfuck (prints "afe", Samoan)
Brainlove (prints "mil", Spanish)
2DFuck (prints "sewu", Javanese)
Python 1 (prints "one thousand", English)
Python 2 (prints "eintausend", German)
Python 3 (prints "hal kun", Somali)
Asar (prints "tuhat", Estonian)
><> (prints "jedna hiljada", Bosnian)
Gol><> (prints "eenduisend", Afrikaans)
Befunge-98 (prints "o mie", Romanian)
Befunge-96 (prints "otu puku", Igbo)
Labyrinth (prints "elf", Maltese)
Hexagony (prints "ett tusen", Swedish)
GNU Make (prints "isang libo", Filipino)
A Pear Tree (prints "hezar", Kurdish)
Octave (prints "tūkstantis", Lithuanian)
Whispers (prints "seribu", Malay)

#ifdef    warnings //[[^
#_ if 0
#{
#(________ )
'''''echo' -n<<"'''+r'''":
    @echo   "isang libo"
define N #
1_801_201_
0
1...@
endif
print "tuhat"
macro _()
#}
disp("t\xc5\xabkstantis")
quit
#{
> "seribu"
>> Output 1
'''+r''':
[ -n "$ZSH_VERSION" ]&&echo een Dausend||([ -n "$BASH_VERSION" ]&&echo duizend||echo nje mije)
:<<"endmacro;\"^*///]\"\"\"#/t#"
#endif
#include<stdio.h>
int main(){puts(sizeof('1')-1?"et tusind":"ib txhiab");}
/*
print"hezar";exit;<<'/*';#NJ@G@GMCI
1234567890123456789012345678901234567890123|u;ts;6ie$;;tn;e@$<
]+[+++[[<+>->+++++>+<<]+>]<<<.<.+++.(.<.)>>+;+;;;;+;;+;;+;;+;;+;;+;+;+;+;+;;+;;+;[-]]![!.!...!..!..!.!..!..!.!.!.!.!...!.!...!.!...!.!.!.!.!][
'''
print(["hal kun","eintausend","one thousand"][(type(1==1)==type(1))+(3/2==1)])
r""""
01234567891234567890123456789012                               1
                       >"ukup uto">:#,_@
                H"eenduisend"\
        >o<"jedna hiljada"~\ u
#}
endef #   >"eim o"4k,@ /"`"/"/"\
endmacro;"^*///]"""#/t#

There should be a hard tab at the start of line 6.
Try it online! (use the switch languages button to try them all)
Length is exactly 1000 ASCII characters, and also 1000 bytes.
Asar is a SNES assembler that has quite sloppy input parsing and thus accepts a lot of  inputs that one may consider invalid. I used version 1.71 for this, downloadable here, and depended on quite a few bugs, so there is a chance this will break in later versions.
All of the other languages are well-known enough to be on TIO.
I used Google Translate for the translations, so they may not be perfectly grammatically accurate. If anyone knows some of the languages better, please suggest improvements, I've got some wiggle room here :)
Credits: @JoKing for some minor optimizations regarding brainfuck, befunge, (gol)><>, hexagony, and python. @flawr for suggesting and helping with octave. @caird coinheringaahing for suggesting whispers.
Fun fact: I made most of this polyglot months ago. It included the first 10 languages mentioned here. (edit: I've since shuffled the language list around a bit so it makes more sense, but check the 2nd oldest version of this polyglot in the edit history and add hexagony to get that list).
Explanation (slightly outdated)
This explanation was made for an older revision. It's hard enough keeping track of all the natural language shuffling (to make more difficult programming languages use shorter natural language words) and Hexagony's constant grid shifting, let alone update the explanation every single revision. I'm leaving this here since it still gives a good overview of how what path most of these languages take.
Asar
Asar is a SNES assembler written by Alcaro in 2011, intended to be backwards-compatible with xkas (written by byuu in around 2006). It doesn't have the nicest code. The first line begins with a special kind of label definition, the label is called ifdef. Then follows a warnings command, which is supposed to control when warnings are thrown. Usually it's followed by either push or pull, but it doesn't reject other words following it. So that's the first line: a label-definition followed by a no-op. The 2nd line is a similar label definition (this time the label is called simply _) followed by an if statement. The condition is 0, so the contents of the if are ignored. This means we can pretty much go wild inside it, the only rule we have to follow is that all double-quotes must be paired. The end of that if statement is at the endif on line 10. After that comes a simple print statement which prints the output. Then comes a macro declaration. Declaring a macro that isn't used is pretty much equivalent to an if 0. The end of the macro declaration is on the very last line. In Asar, comments are started with ;, so the rest of the last line is ignored.
Bash, Zsh, Dash
The first 3 lines are just regular comments. The 4th line is equivalent to echo -n <<"'''+r''':". This is an echo without a linebreak following it. Then we have a heredoc that ends at any occurrence of '''+r''':. The contents of the heredoc are piped to the stdin of that echo command, but that doesn't matter since echo ignores its stdin. After the end of the heredoc on line 14, we have regular shell code that checks whether the variables for either zsh or bash are defined and chooses what to print based on that. After that, we have the null command :, which does nothing, into which we pipe the rest of the script using another heredoc. The heredoc ends with endmacro;"^*///]"""#/t#, which just happens to be the very last line of the script.
C, C++
The first line is a preprocessor directive which checks whether the define "warnings" is defined. There's also a comment after the directive. warnings isn't defined, so the contents of the block are skipped. There are a bunch more garbage preprocessor directives inside the skipped if branch, but they are ignored too. The #endif is on line 18. After that we have a standard C program. It checks whether the size of a character literal is greater than 1 or not. If it's greater, we are in C, because in C character literals are actually of int type, which has a size of at least 2 bytes on literally every platform in use today. In C++, however, the type of a character literal is char, which is defined to have a size of 1, so a different branch is taken.
The rest of the code is a single comment, started with /* at line 21. It's terminated in the middle of the last line, but followed immediately by a single line comment.
Brainfuck
On the first line, we have 2 open brackets. This is because one of them is eaten by the heredoc that ends the shell part, which is before the brainfuck part. There are some balanced brackets within the skipped part too, but they don't matter because they are balanced. The next closing bracket is on line 21, which is also the start of the brainfuck code. I used this text-to-brainfuck converter, because somehow it generated even better output than BF-Crunch. Then follows the boolfuck code, which is mostly ignored due to ; not being defined. The increments don't matter either, we just switch to the next cell which has never been written to so the next open bracket is a guaranteed jump. The next closing bracket after that is on the very last line, and there are no brainfuck instructions after it.
Boolfuck
The boolfuck control flow is quite similar. However, once the brainfuck code is reached, most of it is ignored as - isn't defined in boolfuck. The area with + and ; is where the output is actually printed. It just prints the string "mil" bit by bit, with + negating the current bit and ; outputting it. The rest of the control flow is identical to brainfuck.
Python 1, 2, 3
The first 3 lines are regular comments. The 4th line starts with a triple-quoted string literal, delimited by single quotes. This string literal is often closed and reopened because I needed to get a backslash in somewhere (I've forgotten where), so I needed the string literal to be raw, but I couldn't put the r before the first quotes. Anyways, the first place where the string literal is closed and not immediately followed by another string literal is on line 23, which is the start of the Python code. This code uses a few simple tests to determine which version of Python it's running on: in Python 1.6, there was no separate boolean type, so the results of comparisons were just ints. The first condition checks that. The second condition checks whether division rounds down or not. In Python 2, division on integers rounded the result down, whereas in Python 3, it results in a floating point answer. After the Python code, we have another raw string literal that lasts until the last line, where it is immediately followed by a comment.
><>, Gol><>
Now we get to the 2D languages. Gol><> is almost perfectly backwards compatible with fish, so they start execution the same way. In fish, execution starts from the north east ("top left") corner of the program, with the instruction pointer pointing west. In fish, # is a mirror which reflects the instruction pointer back in the direction it came from. The # causes the IP to point west instead. In fish, program space is topologically a torus, so going off the western edge results in reappearing at the eastern edge of the program. There it encounters ^, which changes the instruction pointer's direction to north. Execution then continues from the very bottom of the script. The IP goes right past the very last character of the program and hits the / on line 31. The / reflects the IP like a mirror, so it'll go east again. Here is where we determine if we are running fish or golfish. In golfish, quotes inside string literals can be escaped with `. So in golfish, the string literal is only terminated on the 3rd quote on that line. In regular fish, however, the backtick escape doesn't exist, so the string literal ends after the 2nd quote. (The 4th quote is needed to keep Asar happy about paired quotes). Then, both IPs are reflected upwards. The fish one goes west on line 30 and follows a pretty simple text printing program. The golfish one goes west on line 29, after switching to a different stack with the u in its path on line 30. There, it follows a very simple string printing code too (just push the string on the stack and call H, which exits and dumps the whole stack as ASCII text).
Befunge-98
In Befunge-98, execution starts out in the north west ("top left") corner of program space, pointing east. # is a trampoline command, it skips the next instruction. The letters a-f just push their hex value on the stack. Spaces are no-ops. w pops 2 items from the stack, compares them, and turns left or right depending on which one is larger. here, f is larger than e (15 is larger than 14), so we turn left, with the IP pointing north. Now we jump to the bottom of the program, like in fish, and follow the path of arrows to line 31. This uses a simple string printing code with the k operator, which repeats the next instruction (print character) some number of times, 5 in this case.
Hexagony
This was the one language that probably costed me the most time while writing this thing. This explanation is a bit oversimplified, go look at Hexagony's README or wiki page if you want to learn more. Hexagony reformats your program into a hexagon. Then execution starts at the north-west corner. The first command, #, switches to the IP with the index of the current memory cell (there are 6 IPs, each one starting at a different corner of the hexagon). Memory is initialized to all 0's though, so this switches to the first IP, which is the one that is already executing. All alphabetic characters simply set the current memory cell to their value, so most of the rest of the 1st line is just no-ops. Then there's a mirror, /, which makes the IP point north-west (as if it got reflected off the mirror). This means the IP will wrap around to the very bottom of the hexagon. There, it happens to hit the / at the very end of the script. This is also a mirror and makes the IP go east again. Then we set the current memory cell to t and use the "switch IP" command again. Since there are only 6 IPs, the current memory cell is taken modulo 6 when switching, so it goes to the 3rd IP, which starts at the eastern corner of the hexagon. This IP starts out moving southwest and it executes some useless operations before reaching the end of line 23 in the original code. There it uses the $ operator to skip over some characters the first time around, then encounters | which turns it around and prints some more characters.
Labyrinth
In labyrinth, control flow is determined by the program's layout. All spaces and alphabetic characters are considered walls. The # command pushes the number of items on the stack, which is 0, to the stack. Then execution continues in the only possible direction, south. Here, the number of items on the stack is pushed again, this time pushing a 1. Now there's 2 directions to go: south again or east. Since the topmost value on the stack is positive, execution would try to go west, but that path is blocked, so it goes east instead. _ pushes a 0. Now there's again 2 directions to go, but we came from one direction and unless nothing else is possible, the IP will never flip around and go back the direction it came from, so we continue south. Here we have a (, which decrements the top of the stack. This means the topmost item is now -1. Excluding the direction we came from, there's 3 directions to go, but since the top of the stack is negative, we go east. Here we push 0 a bunch of times, which means we continue east for as long as possible. In the end, we go south because that's the only other place to go. There we find a ', which is a no-op if debugging output isn't enabled. Now, labyrinth treats tabs as a single space, so the character south of the ' is actually " from the start of the echo's parameters. Execution continues there. Below that, there is only one path to follow, which leads to the 4th character of line 9. There, we simply construct the ascii values corresponding to "elf" and print them.
Make
The first 3 lines are comments. The 4th line is somehow a valid target name. (To be honest, I have no idea either about why this works.) Since this is the first target in the makefile, it's what gets executed when no argument is given to make. The rule just prints the character count. Then we define a variable called N which contains the rest of the script. It ends on the 2nd-to-last line with the endef command. Following it is a comment that ends with a backslash. This causes make to interpret the next line as part of the comment too.
A Pear Tree
A Pear Tree starts execution by finding the longest substring of the program whose CRC32 is 0. Then it shifts the whole program so that said substring is at the start of the program. This long substring with a CRC32 of 0 is print"hezar";exit;<<'/*';#NJ@G@GMCI, which just happens to be valid Perl code. No, actually I used a tool called crchack to generate some letters to add to a comment so that the string's CRC is 0. So this Perl program is shifted to the very beginning of the program. It contains a print statement, an exit statement and a heredoc. The heredoc is terminated by the line that was right before the perl script originally, and thus is at the very end of the program now. So the heredoc skips the entire rest of the script and all of the syntax errors that would arise from not doing so.

Better question would be why did I use 1000 instead of something like 800... i'll try to fit a few more in here

I hereby confirm that at least Dutch (Duizend) is accurately spelled.

For reference, I also know the estonian, english and swedish versions are accurate (being a fluent speaker of the first 2 (or well, fluent enough in the case of english) and having asked a swedish friend of mine).

"Tuhat" is also Finnish :)

But will it matter if the result is going to be 1k characters anyways? Or are you suggesting I change all of the strings to something like 800? (thanks for the suggestions anyways)

@JoKing: That's a fair point, but I think I've exhausted all of the languages that I even barely know by this point. But if you know some that could fit in here, feel free to suggest them.

@JoKing: Is using >o< to output the stack in ><> even valid? It'll print the error message (due to popping off an empty stack), is that allowed?

This is really impressive. I tried both Python 2, Python 3, C, C++, Zsh and Bash. I can't get Make to work however: Makefile:5: *** missing separator.  Stop.. I'm using GNU Make 4.2.1, built for x86_64-apple-darwin19.0.0.

@grooveplex: Are you sure you have a hard tab at the start of line 5?

@randomdude999 Somehow the code snippet didn't have that. Changed it to a hard tab and it works perfectly!

@grooveplex: Yeah, stack exchange removes all hard tabs in posts. You could have copied it from TIO too, they work there.

6 languages, prints 80
//'Ÿ¯"y"«q
   áttatíu/*
";"
åo 八
t?  十
t@   "
io    o
oo     @
"o
0o
1 K`ochenta

(There's also 5/90 solution with a different approach in the edit history if you're interested)
05AB1E/English - eighty
//'Ÿ¯"y"«q
//          # no-ops
  'Ÿ¯       # push dictionary string "eight"
     "y"    # push literal string "y"
        «   # concatenate
         q  # end program

Try It Online!
Once execution ends, the stack top (eighty) is implicitly printed, and nothing later on in the file will be considered at all.
ink/Íslenska - áttatíu
   áttatíu/*

Try It Online!
The very first line in the file is a comment, due to the //. The /* at the end of this line begins a multi-line comment (which we never have to close), so ink doesn't care about anything later on in the file either.
That just leaves the text áttatíu, which ink happily prints, because that is what ink does.
Alice/日本語 - 八十
/

  "
   八
    十
     "
      o
       @

Try It Online!
In Alice, / is a mirror, but unlike in other 2D languages you might be familiar with, they reflect you 135 degrees rather than 90. So after encountering the /, we move diagonally, encountering "八十" (which pushes the string 八十 onto the stack), o (which outputs it), and @ (which terminates the program).
><>/Norsk - åtti
//

";
åo
t?
t@
io
oo
"o
0o
1

Try It Online!
The / at the start deflects the instruction pointer upwards, after which it wraps around to the bottom, travelling up the first column.
It then pushes the numbers 1 and 0 and the characters oittin onto the stack, bounces around on the mirrors at the top, and travels up along the second column.
In the second column, we print the first four items on the stack (åtti). Then we shuffle the last three values around a bit using @, leaving the 0 at the top, which thanks to the ? makes us skip the final print instruction, before we arrive at the ; which ends the program.
Gol><>/Svenska - åttio
//

";
åo
t?
t@
io
oo
"o
0o
1

Try It Online!
Works just like ><> except the @ shuffles the stack values in a different way, so we end up not skipping the last print, thus printing åttio instead of åtti.
Retina/Español - ochenta
1 K`ochenta

Try It Online!
The first ten lines are presumably interpreted as replacement stages, but since we don't have any input to manage, we don't really care what they do. the last stage, however, is a constant stage - we can tell because the config string before the backtick has a K in it. That means we just discard any input that stage would get from the stages before it, and output ochenta.

I like this answer best because it has the highest language to length ratio of all submissions so far.

It doesn't save anything in this case of course (and maybe you've used the two double quotes on purpose to make the length 80), but just in case you didn't know, the "y" could be 'y in the 05AB1E portion of the program. 05AB1E has builtins for 1, 2, or 3 length strings or amount of dictionary words, being ', „, … respectively.

3 Languages, 800 chars

PHP, Norwegian, Outputs ÅTTE HUNDRE
Emoji, Persian, Outputs هشتصد
COW, English, Outputs EIGHT HUNDRED

<?=['ÅTTE HUNDRE','⛽هشتصد➡','
MoO
MoO MoO
MoO MoO MoO
MoO MoO MoO MoO
MoO MoO MoO MoO MoO
MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO MMM MoO MoO MoO
MoO MoO MoO MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO Moo MoO MoO MoO MoO Moo MOo MOo
Moo MoO Moo MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO
MoO MoO Moo MMM Moo MoO MoO MoO MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO
MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO
Moo MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo MOo MOo
MOo MOo MOo MOo MOo Moo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo Moo MMM
MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo MMM MoO Moo MOo Moo'][0];

PHP - Try it online!
COW - Try it online!
Emoji - Try it online!

3 languages, 3 upvotes. Now it is broken.

3 8 9 languages, 300 characters
                            //®di.•paü¾p•ë"兩百"„„í°¡r\}qtrescientos➡\u000A\u002F\u002A
    //\
{{Write("trois cent"/*\u002A\u002Finterface M{static void main(String[]a){System.out.print("driehonderd"                                             /*
    #include<stdio.h>
 int main(){{puts(sizeof'a'<sizeof(int)?"trezentos":"dreihundert"/**/);}}//

Try it online in 05AB1E / Chinese - outputs 兩百.
Try it online in 05AB1E (legacy) / Italian - outputs trecento.
Try it online in 2sable / English - outputs three hundred.
Try it online in Java 8 / Dutch - outputs driehonderd.
Try it online in C# (Visual Interactive Compiler) / French - outputs trois cent.
Try it online in C / German - outputs dreihundert.
Try it online in C++ / Portuguese - outputs trezentos.
Try it online in Whitespace / Japanese - outputs 三百.
Try it online in Emoji / Spanish - outputs trescientos.
Explanation:
05AB1E / Chinese and 05AB1E (legacy) / Italian and 2sable / English:
                    # Spaces/tabs are no-ops
  //                # Divide twice (without input)
                    # Legacy 05AB1E / new 05AB1E: this pushes an empty string
                    # 2sable: the stack remains empty
    ®               # Push -1
     d              # Legacy 05AB1E: check if this -1 is an integer (truthy)
                    # New 05AB1E: check if this -1 is non-negative (≥0) (falsey)
                    # 2sable: check if this consists only of digits (falsey)
      i             # If it is truthy:
       .•paü¾p•     #  Push compressed string "trecento"
      ë             # Else:
       "兩百"       #  Push string "兩百"
       „„í°¡        #  Push dictionary string "one hundred"
             r      #  Reverse the stack
                    #   New 05AB1E: "","兩百","one hundred" → "one hundred","兩百",""
                    #   2sable: "兩百","one hundred" → "one hundred","兩百"
              \     #  Discard the top item
                    #   New 05AB1E: "one hundred","兩百","" → "one hundred","兩百"
                    #   2sable: "one hundred","兩百" → "one hundred"
      }             # Close the if-else
       q            # Terminate the program
                    # (after which the top of the stack is output implicitly as result)
                    # And any character after it are no-ops

See this 05AB1E tip of mine (sections How to use the dictionary? and How to compress strings not part of the dictionary?) to understand why „„í°¡ is "one hundred" and .•paü¾p• is "trecento".
Emoji / Spanish:
                    # Some no-ops
trescientos    # Push string "trescientos"
                ➡  # Print the top to STDOUT
                    # Some more no-ops

Whitespace / Japanese:
Only spaces, tabs, and newlines are relevant for Whitespace programs and every other character is ignored. So the program is actually (S = space; T = tab; N = newline):
SSSTSSTTTSSSSSTSSTN
TN
SSSSSTTTSTTSSTTTTTTSN
TN
SS

SSSTSSTTTSSSSSTSSTN push the integer 19977 to the stack (first S is to enable stack manipulation; second S is to push a number; third S is positive (T would have been negative); the S and T that follow are the integer in binary where S=0 and T=1; and the trailing N finishes this command.
TNSS print this integer as character (with this unicode value) to STDOUT (first TN enables I/O; the following S is to output to STDOUT; and the second S to output as character (T would have been as integer)).
SSSSSTTTSTTSSTTTTTTSN push 30334
TNSS print as character again

C# (Visual Interactive Compiler) / French:
The first line contains some no-op spaces/tab, and a comment (// starts the comment, making everything after it on that same line no-ops).
The second line is similar, again a no-op tab and a comment.
The third line starts with {{Write("trois cent", and /* starts a (potentially multi-line) comment-block. This stops at the */ on the last line, making everything in between no-ops. After which );}} is part of the C# program again (and the very last // is a comment again, only there to make the program-size 300).
So the non-comment parts of the C# (Visual Interactive Compiler) program are:
{{Write("trois cent");}}

The {{ and }} are code-blocks, and basically no-ops in this case.
The Write("trois cent"); prints this text to STDOUT.
C / German and C++ / Portuguese:
First line is a comment again.
The //\ on the second line is relevant in C and C++, as it will comment out the entire next line.
The #include<stdio.h> and int in front of the main-function are mandatory in C++ (and optional in C; it would run fine without these two parts, but would generate some warnings).
The /**/ and // are again comments.
So the non-comment parts of the C and C++ programs are:
#include<stdio.h>         // Required include for `puts` in C++
int main(){               // Mandatory main-function:
  {                       //  No-op code-block (similar as the C# part above)
    puts(                 //   Print to STDOUT with trailinb newline:
      sizeof'a'           //    If the byte-size of character 'a'
      <                   //    is smaller than
      sizeof(int)?        //    the byte-size of an integer:
       "trezentos"        //     Print "trezentos"
      :                   //    Else:
       "dreihundert");}}  //     Print "dreihundert"

In C (and Java), values of type char are saved as an integer. sizeof(int) and sizeof'a' will therefore both result in 4 in C, and 4<4 is falsey, so "dreihundert" is printed. In C++ (and C#), values of type char are actually a separated type saved as characters. sizeof'a' will therefore result in 1 in C++, and 1<4 is truthy, so "trezentos" is printed.
Java 8 / Dutch:
In Java, we can use \uHEX as unicode values, which are read as characters after compilation. The very first line therefore compiles to (I'll ignore the leading spaces/tabs for now to make it a bit more compact):
//®di.•paü¾p•ë"兩百"„„í°¡r\}qtrescientos➡
/*

The \u000A\u002F\u002A are a newline, / and * respectively. Just like in the C# program, this will stop at the first */, which is the \u002A\u002 on the third line in this case. There the Java program starts:
interface M{static void main(String[]a){System.out.print("driehonderd"

After that come a bunch of no-op spaces/tabs again, followed by another /* which stops at the same place as the C# program. So the full Java program is:
interface M{static void main(String[]a){System.out.print("driehonderd");}}

interface M{                    // Class:
  static void main(String[]a){  //  Mandatory main method
    System.out.print(           //   Print to STDOUT
      "driehonderd");}}         //    The string "driehonderd"

Why these languages?
Natural languages:

I'm fluent in English and Dutch
I've learned French and German at high school
I watch quite a lot of Japanese anime
I know a few loose words in Spanish, Italian, and Portuguese
Chinese was short enough to fit after adding 2sable ;)

Programming languages:

I'm pretty skilled at Java, 05AB1E, C#, and Whitespace
I've used the polyglot tricks for combining Java & C as well as Java & C# before here and here
I've seen the C / C++ difference before, and it was therefore easy to add here
Emoji is a perfect language to add, since it ignores everything except for the relevant emoji commands (unlike Emojicode I tried to add as well..)
2sable is based on an old version of 05AB1E (legacy), and therefore rather similar as 05AB1E and 05AB1E (legacy), except it's a bit older than both.

I might try to learn and add Aheui for a suiting Korean output later on, since it will ignore everything except for the Korean characters in the code.

Nice answer. I hope that, after Whitespace, we (the code golf community) can go out on a bender and add some off the wall natural language to the mix. Romansh, anybody?

I do wish that there is a Romansh translator.

3 4 languages, outputs 20

Actually:Japanese
05AB1E:Vietnamese
Emoji:Danish
Underload:Cantonese

This answer is inspired by this answer. Let's see whether I can fit in the 4th 5th language in 20 characters.
(廿)"二十""hai"tyve➡S

Try it online in Actually!
Try it online in 05AB1E!
Try it online in Emoji!
Try it online in Underload!
Explanation
Actually:
(                           Roll empty stack left
 廿                         Unidentified instruction
   )                        Roll empty stack right
    "二十""hai"             Push 2 strings
               t         Pop a, b, push a[b:]. Nothing special since b is a string.
                   y        Push prime factors of the string on the top of the stack
                    v      Discard TOS for the seed of the RNG
                     e     Push exp(Top Stack String)
                      ➡S Sort the Top Of Stack; no effect to the text

Outputs the whole stack implicitly.

05AB1E:
(                           Negate the empty stack
 廿                         Unidentified instruction
   )                        AFAICT this is a NOP
    "二十""hai"             Push 2 strings onto the stack
              t           Square root top of the stack string
                  y         Push string variable
                   v        Enumerated loop
                    e       Number of permutations
                     ➡S Cast to list of characters / digits.

This outputs the TOS implicitly.

Emoji:
(廿)"二十""hai"             No operations
              tyve➡  Output tyve
                          S NOPs

Underload:
(廿)                         Push 廿 onto the stack
    "二十""h                 NOPs
            a                Enclose TOS with braces
             i"tyve➡  NOPs
                           S Output TOS
```


text:
Busy beaver of sorts
I'm surprised this hasn't been done yet, but here we go.
Create a program which prints some number of 1s (ideally as large as possible) before halting.
The rules are simple:
Your program is bounded to 50 bytes in size.
Your output must only be a continuous row of 1s (plus trailing newline if it has to be added), without any breaks in the middle.
Your program must halt. No infinite loops.
Your program must not use STDIN or output to STDERR.
Your program must use STDOUT or closest equivalent.
Your score is the amount of 1s your program prints before halting.
Have fun.

Well, there have been many extremely related challenges, with the only significant difference that they didn't arbitrarily demand unary output (https://codegolf.stackexchange.com/questions/18028/largest-number-printable is the first one I can recall; there have been some like "Golf a number bigger than [insert large number name here]")

I was looking to emulate busy beaver Turing machines in this challenge.

Runic Enchantments, Score: Aproximately (10↑↑200) (10↑↑303)18.877
>>>yybbqf:p'!A'!A'!A'!A'!A'!A'!A'!A'!A'!AFm1)b*?*@

Try it online!
Utilizes Stephen's idea of factorials (they're kind of expensive in Runic, so I hadn't considered them originally) and managed to squeeze out two three hundred of them via implicit edge looping. Value-in is 15^15 (437,893,890,380,859,375) and the resulting value is then multiplied against the string 1111 (bbq is just as long as "1" and produces more 1s).
200->300 accomplished by removing flow control logic and simply raising the "skip when true" to jump over the start of the program (executes the :p for bonus length, but is dwarfed by the factorials, but is responsible for the extra 3 powers of 10 in the tower).
"Wolfram|Alpha doesn't understand your query"

MATLAB, Score: 9↑↑(2↑(10↑313))
x=9;
while(cputime<realmax/2)
x=x^x;
end
ones(1,x)

Try it online!
cputime counts the number of seconds that the MATLAB thread actually runs on the CPU as a double. realmax is the maximum double, ~10^308; I divide by 2 because cputime will rollover back to zero and we actually need the loop to stop. According to the profiler, on my computer MATLAB can run the loop 1e6 times in about 3.7 seconds. That means we'll perform x=x^x about 10^313 times! That isn't just 9↑↑(10↑313), because it compounds on every loop. It's  9↑↑(2↑(10↑313)) I think. I could cheat and make the condition cputime==realmax/2, and then it would be up to random chance when the program finally ends, making an absolutely insane number, but one that can't be calculated.

MATLAB, Score: 9↑↑79 (or about (10↑↑78)8.568)
f=@(x) factorial(x)^x;
ones(1,f(f(f(f(9^9^9^9)))))

Try it online!
Probly not as big as the power tower answers though. I need to figure out a short way to do that here.

@Draco18s Sorry I overwrote your edit. Can you figure out about how big this version is? Wolfram stalls out

@Draco18s Nah, the ^x does something. factorial(9^9^9^9)^factorial(9^9^9^9) is already 10||9 https://www.wolframalpha.com/input/?i=factorial%289%5E9%5E9%5E9%29%5Efactorial%289%5E9%5E9%5E9%29

@Draco18s I'll try to work it out later, with Stirling's approximation or something

Think I figured it out. On some value x↑↑y your lambda f results in (x↑↑(y+1))^(x↑↑y). For some value (x↑↑y)^(x↑↑z) that is equal to x↑↑(y+z). So your answer should have a score of 9↑↑79 (which is a little less than 10↑↑79; (10↑↑78)^8.568).

@Draco18s Nice! Go ahead and edit if you want

Was definitely one of those "go get lunch and mull over the problem" sort of solutions. I ran through what "10↑↑2 ^ 10↑↑2" meant and then the pattern made sense.

@Draco18s Did I calculate this new one correctly?

@Draco18s I didn't consider the loop will start running slower and slower but whatever

*Shrug* My answer would suffer from bit-overflow (and memory) long before actual termination. Usually with busy-beaver type problems there's an assumption of infinite memory. The loop you have looks like it would have linear execution, so its treated as linear (even as when more and more bits get coopted to store the result it does take longer). (I also cleaned up some no-longer-needed comments)

@Draco18s Ok yeah it should be linear. This isn't BigInteger. But I think I did goof: shouldn't it be 9||(2|(10|313))? It doubles every loop

9↑↑(2↑(10↑313)) would be correct, yeah.

cQuents, Aproximately (10↑↑45)7.347
"#t!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&1

Try it online!
Note that it does not start printing the 1s until it calculates the result of the factorial, so this probably will not run on any real system.
According to Wolfram Alpha, this value equals

or in plaintext
10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^7.346902562777663))))))))))))))))))))))))))))))))))))))))))))

I originally discounted factorials because computing one in Runic takes 3 bytes, but they're individually powerful, definitely boosted my score.

Python 3 approx 9↑↑(36^8) 9↑↑(36↑(9↑↑3))
print("1"*eval("**".join("9"*int('z'*9**9**9,36)))

Must calculate first.
(Edited because I'm bad at math notation, and to include an improvement from  randomdude999)

9**9**9 is larger than 9999999.

Pretty sure your score is correct, though I am not 100% certain (for reference x↑↑y ~= 10↑↑y; the y makes a bigger impact and that's a BIG y).

@Draco18s The int(..., 36) means "This number in base-36". With the first argument, it's 'zzzz....' as an integer with 0-9 then a-z as the digits. So, I'm pretty sure that it's just one arrow.

I knew what the command was, I just couldn't deal with what the resulting value was. I think you're correct though.

@Draco18s Oh gotcha. Thanks for the help with the notation! Never been my strong suit.

Yep, ended up having some understandings in that regard, too. Just like x^y * x^z = x^(y+z), (x↑↑y)^(x↑↑z) is equal to x↑↑(y+z). I just found it really fascinating that factorial(x↑↑y) equals* x↑↑(y+1). *Or is at least a pretty good approximation.

The result can be approximated to 9↑↑9↑↑4, which in turn is somewhere between 9↑↑↑2 and 9↑↑↑3. From my understanding, this means it should be the highest score at the moment.

Python, 9^9^9^9^9^9^9^9^9^9^9^9^9 (or 9↑↑13)
print("1"*(9**9**9**9**9**9**9**9**9**9**9**9**9))

I hope this is right
Try it online!

you are right, my bad

PHP, 43 bytes, Score: ~1e17 (based on my PC performance)
set_time_limit(-1);while(time()<4e9)echo 1;

Try it online!
This will run until 2096-10-02 and then stop. This isn't an infinite loop as it will finally halt. I can set it to longer dates, but I think 4e9 or 2096-10-02 is good enough for me, it is about the idea

This is dumb, but it works.

Even if this printed one 1 every nanosecond this would score much less than most of the other answers so far.

@FryAmTheEggman, true.

05AB1E, approx. (10↑↑46)10.994 amount of 1s (50 bytes)
žm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1×

Explanation:
žm             # Push the builtin 9876543210
  !!!...!!!    # Take the factorial 46 times
           1×  # Push that many 1s as string
               # (after which it's output implicitly as result)

This will print exactly \$9876543210↑↑46\$ amount of 1s, or approx. \$(10↑↑46)^{10.994}\$ (thanks to @Draco18s for explaining how to calculate this \$(10↑↑a)^b\$ approximation.

how large 9876543210↑↑56 is. Only about (10↑↑56)^11. Two arrows (10↑↑2) is just powers (10^10) (or 10↑↑3 -> 10^10^10), so the number on the right matters more than the number on the left. It works out that each factorial adds a 10 to the tower. Also, I think your tower is 46, not 56.

@Draco18s Oops, 46 instead of 56 indeed, edited. I know $10↑↑3$ is $10^{{10}^{10}}$, I just wasn't sure how large $9876543210↑↑46$ is when using $10↑↑x$ as well. I'm still not sure how you calculated that $11$ in $9876543210↑↑56 ≈  (10↑↑56)^{11}$ to be honest, or is the $11$ the size of the integer on the right + 1?

I understood why you had the question, it just works out that x↑↑y is approximately equal to (10↑↑y) (or closer to (10↑↑y)^(log10(2x))). eg 100↑↑4 and 10↑↑4. Note that the first one is (10↑↑4)^2.3, but W|A displays powers of ten up to 5 digits, but we can extract the right value. The log10 bit just tacks on to the end of the stack (100↑↑4 -> 10^10^10^10^2.3), parents only distinguish it from 10↑↑(10^2.3) (wrong!)

@Draco18s Hmm ok. But why the $11$ then? Since $\log_{10}(2×9876543210)$ seems to be approx. $10.296$ instead of $11$. So the $9876543210↑↑46$ in my answer would be roughly $(10↑↑46)^{10.296}$ in that case?

Works out to what happened when I plugged it (9876543210) in to W|A 5 times. I got 10.994. The log10(2x) is only an approximation, and its a bit low. (100 results in a power of 200.3 on top of the tens, for example, not exactly 200). But if I plug in 15 copies instead of 5, that last value doesn't change (or if it does, its very small), so its easy to extrapolate what happens at 50 copies.

@Draco18s Ah ok, now it makes a bit more sense, thanks. I'll edit my answer to add the $10↑↑x$ notation.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Calculate the internal angles of a regular polygon with N sides
This is a simple challenge: given n in any way practical (Function arg, stdin, file, constant in code) output the internal angles
(NOT the sum of the internal angles, just one) of a regular polygon with n sides. The output can be in degrees, gradians or radians, and can be displayed in any way practical (Function return, stdout, stderr if you feel like it, file etc)
As usual, smallest byte count wins.

Degrees, radians, grads, or user discretion?

@JeffZeitlin user discretion, will edit to clarify

Do you mean the sum of the internal angles or the value of one of the angles?

@HiddenBabel value of one. I'll edit to clarify

Is there a higher/lower bound on what we have to support? i've got an idea for an answer with a microcontroller language but it can only really support upto 255

@AlexRobinson yeah that's fine, just specify in your answer.

MathGolf, 6 5 4 bytes
⌡π*╠

-1 byte thanks to @someone nu outputting in gradians instead of degrees.
Another -1 byte by outputting in radians instead.
Try it online.
Outputs in radians by using the formula: \$A(n) = \frac{(n−2)×\pi}{n}\$.
Explanation:
⌡     # Decrease the (implicit) float input by 2
 π*   # Multiply it by PI
   ╠  # Then divide it by the (implicit) input (b/a builtin)
      # (after which the entire stack joined together is output implicitly as result)

I think you can use 200 instead of 180 to output in gradians instead of degrees; that should be possible to encode in 2 or 1 bytes.

@someone Thanks. But I just realized that simply outputting in radians is even shorter than gradians or degrees.

Perl 6, 8 bytes
π- τ/*

Try it online!
Output in radians. Simple function in WhateverCode notation which computes \$π-τ/n\$. \$τ\$ is the constant tau equaling \$2π\$.

Python 3, 18 bytes
lambda s:180-360/s

An unnamed function which returns a floating point number of degrees. (For gradians swap 180 for 200 and 360 for 400.)
Try it online!

JavaScript, 12 bytes
n=>180-360/n

Try it Online!

Shakespeare Programming Language, 242 226 203 bytes
Try it online!
(Whitespace added for readability only)
N.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]
Ajax:Listen tothy.
You is the quotient betweenthe product ofthe sum ofyou a big pig twice the square oftwice the sum ofa big big cat a cat you.
Open heart

Explanation: I use the formula ((n-2)200)/n. Input in STDIN. Much of this program is the number 200, which I represent as 2*2*2*(1+2*2*2*(2+1)). Saved 16 bytes by switching to gradians, since 180 is harder to represent than 200. Saved 23 bytes by instead representing 200 as 2*(2*(4+1))^2.

WDC 65816 machine code, 20 bytes
Hexdump:
00000000: a2ff ffa9 6801 e838 e500 b0fa 8600 a9b5  ....h..8........
00000010: 00e5 0060

Assembly:
    ; do 360/n (using repeated subtraction... it'll go for at most 120 loops anyways, with sane inputs)
    LDX #$FFFF
    LDA.w #360
loop:
    INX
    SEC
    SBC $00
    BCS loop
; quotinent in X now. do 180-X
    STX $00
    LDA.w #181 ; carry is clear here, so compensate by incrementing accumulator
    SBC $00
    RTS

Input in $00, output in A. Overwrites $00 and X. 16-bit A/X/Y on entry (REP #$30).
Apparently I'm the only one using \$ 180 - \frac{360}{n} \$ instead of the more conventional formula. Note that this code rounds the division downwards, and thus rounds the result upwards.

R, 21 20 14 bytes
-7 thanks to Robin Ryder. Outputs in radians

pi-2*pi/scan()

Try it online!

20 bytes

You can make it 14 bytes with scan().

@RobinRyder Nice. Not sure why I forgot about scan().

APL (Dyalog Unicode), 6 bytes
○1-2÷⊢

Try it online!
The result is in radians. It implements pi * (1 - 2 / x). The big circle is the "pi times" function.

05AB1E, 6 bytes
ÍƵΔ*I/

Try it online or verify some more test cases (output in degrees).
Explanation:
Uses the formula \$A(n) = \frac{(n-2)×X}{n}\$ where \$n\$ is the amount of sides, and \$A(n)\$ is the interior angle of each corner, and \$X\$ is a variable depending on whether we want to output in degrees (\$180\$), radians (\$\pi\$), or gradians (\$200\$).
Í       # Decrease the (implicit) input by 2
 ƵΔ*    # Multiply it by the compressed integer 180 (degrees output)
 žq*    # Multiply it by the builtin PI (radians output)
 т·*    # Multiply it by 100 doubled to 200 (gradians output)
    I/  # Divide it by the input
        # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress large integers?) to understand why ƵΔ is 180.

Japt, 8 7 bytes
Í*-#´/U

Try it
Í*-#´/U     :Implicit input of integer U
Í           :Subtract from 2
 *          :Multiply by
  -#´       :-180
     /U     :Divided by U

Taking a page out of Kevin's book, see this Japt tip to find out why #´ = 180.

Python 3, 20 bytes
lambda n:(n-2)*180/n

Try it online!

Nice answer. Quick tip - when you use Try it Online you can click on the link icon then choose the option to copy a code golf submission. When you paste that into your answer it will be all nicely formatted without you having to do the hard work :)

You can save 2 bytes by expanding to get lambda n:180-360/n

@MatthewJensen thanks for the improvment but there is someone else who commit this

C (gcc), 18 bytes
z(n){n=180-360/n;}

Try it online!

The above has accuracy issues on some inputs, below does not within the constraints of a float.  The same could be said about slightly longer code which uses doubles... it's data types of ever increasing width all the way down.
C (gcc), 30 bytes
float z(float n){n=180-360/n;}

Try it online!

26 bytes

You can remove the space after the return.

Instead of return, use n= https://tio.run/##S9ZNT07@/79KI0@zOs9WI0/XSFPL0MJAP8@69n9mXolCbmJmnoYmVzWXAhCABPKswczi5MS8NA0l1RQlHQW1PE2IYEERUAVMFGQkVLwotaS0KE/BwJqr9r8xAA

@girobuz How does that work? Does the compiler store the intermediate results in eax?

@JL2210 I don't remember, but I think it has to do with the fact that the return value uses the same register as last function parameter. I don't remember anything else. Definitely look it up.

@ceilingcat You can go a bit farther with that define, I did at one point but wondered if it was against the spirit.

@girobuz what an interesting fact.  Obviously not portable but truly interesting.  Updated.

@foreverska same trick works for float arguments.

@ceilingcat yes, that's correct.  What you can also do is access the local variable in main() from the define directly and skip the function-like invocation.
My problem comes that the define itself is not compileable code so it feels cheese.  Am I being too self-restrictive?

Sorry, wasn’t referring to the #define; was referring to the fact that the first float parameter register %xmm0 is also used to return float values.

@ceilingcat oh, interesting.  Thanks.  Updated.

18 bytes unless there's some reason that 180-(360/n) produces incorrect results.

@Draco18s I went down a deep dark hole trying to find clarification on this yesterday without any luck.  But it seems to be accepted math in more than one answer so who am I to gatekeep.  Updated.  Thanks.

Wolfram Language (Mathematica), 9 bytes
Pi-2Pi/#&

Try it online!
Returns the angle, in radians.

APL (Dyalog Unicode), 11 9 bytes
180-360÷⊢

Try it online!
Train that returns the value of each angle in degrees. Shaved a couple bytes off by switching to a smaller formula.

Excel, 11 bytes
=180-360/A1

Result in Degrees.
For Degrees (and Gradians), 3 bytes can be saved by simplifying =(A1-2)*180/A1.
The Radians version though remains the same length:
=(A1-2)*PI()/A1
vs
=PI()-2*PI()/A1.  Shortest Radians answer is 14 bytes: =(1-2/A1)*PI()

Jelly, 6 bytes
_2÷×ØP

A monadic Link accepting an integer which outputs a float.
Try it online!
How?
_2÷×ØP - Link: integer, sides
 2     - literal two
_      - (sides) subtract
  ÷    - divided by (sides)
    ØP - literal pi (well, a float representation of it)
   ×   - multiply

Cubix, 31 bytes
U;o;O@...I2-'´*p,O;%u//'O;oS@!

Try it online!
Outputs degrees as a integer and a fraction (if needed).  This was interesting to do as, there is no floats in Cubix.  I hope the output format is OK for the challenge.
Wrapped onto a cube
      U ; o
      ; O @
      . . .
I 2 - ' ´ * p , O ; % u
/ / ' O ; o S @ ! . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Watch It Run

I2-'´* Get n input, take away 2, push 180 and multiply
p,O; Bring initial input to the TOS, integer divide, output integer and pop
%u! Do modulo, u-Turn to the right, test for 0

@ if zero halt

So;O push 32 (space) onto stack, output as char and pop.  Output modulo result
'// push / to stack and reflect around the cube.  This will end up on the top face after jumping an output
o;U;O@ output the /, pop, u-Turn to the left, pop and output the input

Retina 0.8.2, 44 42 39 bytes
crossed out 44 is still regular 44
.+
$*
^11
$' $&
\G1
180$*
(?=1+ (1+))\1

Try it online! Explanation:
.+
$*

Convert to unary.
^11
$' $&

Make a copy that is two less than the input.
\G1
180$*

Multiply that copy by 180.
(?=1+ (1+))\1

Divide by the original input and convert to decimal.
In Retina 1 you would obviously replace the $* with * and hence the 1 with _ but you could then save a further 5 bytes by replacing the middle two stages with this stage:
^__
180*$' $&

R, 18 bytes
Hardly a new answer, but since I cannot comment I'll post it anyway.
Output is in radians.
n=scan();pi-2*pi/n

Try it online!

Bash, 21 bytes
Same answer as everyone else, but in Bash :)

echo $[($1-2)*180/$1]

Try it online!

No floats in Bash? echo $[180-360/$1] does the same (except for rounding) for 18.

No, Bash does not do floating point.

J, 9 bytes
%~180*-&2

Try it online!
or
J, 9 bytes
180-360%]

Try it online!
K (oK), 8 bytes
180-360%

Try it online!

J, 8 bytes
%o.@*-&2

Try it online!
Implements pi * (x - 2) / x. Just like APL, J has the "Pi times" built-in o..
How it works
%o.@*-&2
     -&2  x - 2
%   *-&2  (1/x) * (x - 2)
 o.@      Pi times the above

Forth (gforth), 25 bytes
: f 180e 360e s>f f/ f- ;

Try it online!
Output is in degrees
Code Explanation
: f          \ start a new word definition
  180e       \ put 180 on the floating point stack
  360e       \ put 360 on the floating point stack
  s>f f/     \ move n to the floating point stack and divide 360 by n
  f-         \ subtract result from 180
;            \ end word definition

Zsh, 17 bytes
<<<$[180-360./$1]

Try it online!

Pending consensus, the following may be a valid 15 byte solution, or more likely a 17 byte tie with () declaring it a function:
((180-360./$1))

Try it online!

Runic Enchantments, 8 bytes
PPi2,,-@

Try it online!
Output is in radians.
Explanation
P           Push Pi
 P          Push Pi
  i         Read input
   2        Push 2
    ,       Divide
     ,      Divide
      -     Subtract
       @    Output and terminate

Works out to Pi-(Pi/(i/2)) which is equivalent to Pi-(2Pi/i) (PP2*i,-@, same length), I just liked the "push all the parts, then do all the math" arrangement ("it looked prettier").

SimpleTemplate, 37 bytes
Just uses the simple formule 180-360/n used on other answers.
Due to ... sub-optimal ... math support, the formule was adapted to (-360/$n)+180 (it's almost the same, calculated in a different order).
{@set/A-360 argv}{@incby180A}{@echoA}

You can try it on: http://sandbox.onlinephpfunctions.com/code/00b314dee3c10139928928d124be9fc1c59ef4bf
On line 918, you can change between golfed, ungolfed and fn, to try the variants below.
Ungolfed:
{@set/ A -360 argv}
{@inc by 180 A}
{@echo A}

Yeah, there's not much to ungolf...
Explanation:

{@set/ A -360 argv} - Stores in A the result of -360/argv.
argv is a variable that holds all passed arguments (in a function or when running the code).
A is now an array with argc elements (argc holds the number of aguments passed).
{@inc by 180 A} - Increments all values of A by 180 (A+180, basically)
{@echo A} - Outputs the values of A, without delimiter.
One could use {@return A} if inside a function, to get an usable array.

Function alternative:
Converting to a function to get an usable array is easy:
{@fn N}
    {@set/ A -360 argv}
    {@inc by 180 A}
    {@return A}
{@/}

Creates a function N that takes multiple arguments and returns an array.
Just call it as {@call N into <variable> <argument, arguments...>}.

If you are curious, this code compiles to the following:
// {@set/A-360 argv}
$DATA['A'] = array_map(function($value)use(&$DATA){return (-360 / $value);}, $FN['array_flat']((isset($DATA['argv'])?$DATA['argv']:null)));

// {@incby180A}
$DATA['A'] = $FN['inc'](isset($DATA['A'])?$DATA['A']:0, 180);

// {@echoA}
echo implode('', $FN['array_flat']((isset($DATA['A'])?$DATA['A']:null)));

PHP (7.4), 21 18 bytes
-3 bytes thanks to Jonathan Allan.
fn($n)=>180-360/$n

Try it online!

Like my Python answer fn($n)=>180-360/$n for 18.

@JonathanAllan, thanks for the more compact formula.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Shorthand Combined Functions
I was doing some investigation into trig functions using compound angles recently, and noticed that the results are really long and tedious to write:
$$
\cos(A+B) = \cos A \cos B - \sin A \sin B \\
\cos(A-B) = \cos A \cos B + \sin A \sin B \\
\sin(A+B) = \sin A \cos B + \sin B \cos A \\
\sin(A-B) = \sin A \cos B - \sin B \cos A \\
$$
$$
\tan(A+B) = \frac{\tan A + \tan B}{1 - \tan A \tan B}
$$
$$
\tan(A-B) = \frac{\tan A - \tan B}{1 + \tan A \tan B}
$$
Realising this, I devised a shorter, golfier way, of writing such expressions:
<direction><operator>[functions](variables)

Where direction is either « or » and operator is in the string +-*/

Also, when there is more variables than functions, the variables are, in a sense, left shifted through the functions, with unused variables simply being concatenated to the expression:
»-[f,g](x,y,z)

Turns into:
$$
f(x)g(y)z - f(y)g(z)x - f(z)g(x)y
$$
Note that the variables x, y and z are left shifting through the functions

Note that when there is only one function given, it is applied as if the expression was an algebraic expansion. For example:
«+[cos](a,b)

Turns into
$$
cos(a) + cos(b)
$$

For an expression like «+[f, g, h](foo, bar, baz), each function in the function list (f, g, h)  is applied to every variable, as if the expression was being algebraically expanded:
f(foo)f(bar)f(baz)
g(foo)g(bar)g(baz)
h(foo)h(bar)h(baz)

These expressions are then concatenated with the provided operator (when the operator is *, the expressions are simply concatenated without any symbols):
f(foo)f(bar)f(baz) + g(foo)g(bar)g(baz) + h(foo)h(bar)h(baz)

For an expression like »+[f, g, h](foo, bar, baz), each function in the function list (f, g, h) is applied to the variables in sequence, as if the variables were "shifting" through the functions:
f(foo)g(bar)h(baz)
f(bar)g(baz)h(foo)
f(baz)g(foo)h(bar)

These expressions are once again concatenated using the above method:
f(foo)g(bar)h(baz) + f(bar)g(baz)h(foo) + f(baz)g(foo)h(bar)

Some Clarifications
When the direction is » and there are more variables than functions , the following method is applied:
FOR j = 0 TO length of functions
 FOR i = 0 TO length of variables
  IF i >= length of functions - 1 THEN
   Result += variables[i]
  ELSE
   Result += Functions[i] + "(" + variables[i] + ")"
 NEXT i
 Left shift variables
 Result += operator
NEXT j

Given the expression »-[f,g](x,y,z), this would turn into:
f(x)g(y)z - f(y)g(z)x - f(z)g(x)y

Empty function lists should return an empty expression, as should empty variable lists.
When there are more functions than variables and the direction is », simply ignore the functions in the functions list whose index is greater than the length of the variables list. For example, given »+[f,g,h](x,y):
f(x)g(y) + f(y)g(x)

The Challenge
Given a shorthanded string as described above, output the expanded expression
Test Cases
Input -> Output
«+[cos,sin](a,b) -> cos(a)cos(b) + sin(a)sin(b)
»+[cos,sin](a,b) -> cos(a)sin(b) + cos(b)sin(a)
«[f](x,y,z,n) -> f(x)f(y)f(z)f(n)
«+[f](x,y,z,n) -> f(x) + f(y) + f(z) + f(n)
«+[f,g]() ->
»*[f,g]() ->
»-[f,g](a,b) -> f(a)g(b) - f(b)g(a)
»[g,f](a,b) -> g(a)f(b)g(b)f(a)
«+[tan](a,b) -> tan(a) + tan(b)
»+[](a,b) ->
»-[f,g](x,y,z) -> f(x)g(y)z - f(y)g(z)x - f(z)g(x)y
«/[f,g](x,y,z) -> f(x)f(y)f(z) / g(x)g(y)g(z)
«[]() ->
»[]() ->
»+[x,y](foo,bar,baz) -> x(foo)y(bar)baz + x(bar)y(baz)foo + x(baz)y(foo)bar
»+[f,g](x) -> f(x) + g(x)
«+[f,g](x) -> f(x) + g(x)
»+[f,g,h](x,y) -> f(x)g(y) + f(y)g(x)

Let it be known that:

The direction will always be given
The operator is optional
The [] denoting the functions will always be present, but will not always contain functions
The () denoting the variables will always be present, but will not always contain variables
Functions can be outputted in any order just as long as the expressions are in order (cosAsinB - sinAsinB can be written as sinBcosA - sinBsinA but not as sinAsinB - cosAsinB)
Variable names can be of any length
The « and » can be taken as < and > if wanted (« and » are preferred however)

Therefore, if no functions/variables are present, then an empty output is required. Whitespacing within the answer doesn't matter (i.e. newlines/extra spaces don't invalidate outputs).
Input can also be taken as:
[direction, operator, [functions], [variables]]

In which case, direction will be a string, operator will be either an empty string or an operator, functions will be a (sometimes empty) list of strings, as will variables.
Score
This is code golf, so fewest bytes wins. Standard loopholes are forbidden.
Leaderboards
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=194719;
var OVERRIDE_USER=8478;
var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;function answersUrl(d){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+d+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(d,e){return"https://api.stackexchange.com/2.2/answers/"+e.join(";")+"/comments?page="+d+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(d){answers.push.apply(answers,d.items),answers_hash=[],answer_ids=[],d.items.forEach(function(e){e.comments=[];var f=+e.share_link.match(/\d+/);answer_ids.push(f),answers_hash[f]=e}),d.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(d){d.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),d.has_more?getComments():more_answers?getAnswers():process()}})}getAnswers();var SCORE_REG=function(){var d=String.raw`h\d`,e=String.raw`\-?\d+\.?\d*`,f=String.raw`[^\n<>]*`,g=String.raw`<s>${f}</s>|<strike>${f}</strike>|<del>${f}</del>`,h=String.raw`[^\n\d<>]*`,j=String.raw`<[^\n<>]+>`;return new RegExp(String.raw`<${d}>`+String.raw`\s*([^\n,]*[^\s,]),.*?`+String.raw`(${e})`+String.raw`(?=`+String.raw`${h}`+String.raw`(?:(?:${g}|${j})${h})*`+String.raw`</${d}>`+String.raw`)`)}(),OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(d){return d.owner.display_name}function process(){var d=[];answers.forEach(function(n){var o=n.body;n.comments.forEach(function(q){OVERRIDE_REG.test(q.body)&&(o="
"+q.body.replace(OVERRIDE_REG,"")+"
")});var p=o.match(SCORE_REG);p&&d.push({user:getAuthorName(n),size:+p[2],language:p[1],link:n.share_link})}),d.sort(function(n,o){var p=n.size,q=o.size;return p-q});var e={},f=1,g=null,h=1;d.forEach(function(n){n.size!=g&&(h=f),g=n.size,++f;var o=jQuery("#answer-template").html();o=o.replace("{{PLACE}}",h+".").replace("{{NAME}}",n.user).replace("{{LANGUAGE}}",n.language).replace("{{SIZE}}",n.size).replace("{{LINK}}",n.link),o=jQuery(o),jQuery("#answers").append(o);var p=n.language;p=jQuery(""+n.language+"").text().toLowerCase(),e[p]=e[p]||{lang:n.language,user:n.user,size:n.size,link:n.link,uniq:p}});var j=[];for(var k in e)e.hasOwnProperty(k)&&j.push(e[k]);j.sort(function(n,o){return n.uniq>o.uniq?1:n.uniq<o.uniq?-1:0});for(var l=0;l<j.length;++l){var m=jQuery("#language-template").html(),k=j[l];m=m.replace("{{LANGUAGE}}",k.lang).replace("{{NAME}}",k.user).replace("{{SIZE}}",k.size).replace("{{LINK}}",k.link),m=jQuery(m),jQuery("#languages").append(m)}}
body{text-align:left!important}#answer-list{padding:10px;float:left}#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px}
  <link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/primary.css?v=f52df912b654">

Winners by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}

{{LANGUAGE}}	{{NAME}}	{{SIZE}}

I know the spec says that the output should be empty if no functions are given, but »+[](a,b) really could be ab+ba as per the more variables than functions rule.

Can we take the inputs in a different order or more convenient format (i.e. operator, direction, [[functions], [variables]])? Or is either "operatorDirection[function](variables)" as string or [direction,operator,[functions],[variables]] as list or loose parameters in this exact order and format mandatory?

Also, could you add some test cases with 3 or more functions? Or is the amount of functions guaranteed to be 0, 1, or 2?

@KevinCruijsen Yep, you can take input in any convenient form. I'll add more test cases once I have access to my computer (I'm mobile bound until tomorrow)

May we output f(x)g(y)zf(y)g(z)xf(z)g(x)y (with the zf and xf concatenated like that) for input »[f,g](x,y,z), or do we explicitly need to add a * in that case? I would personally allow it and ignore the syntax error, since it's otherwise an annoying (although not hard) edge case to fix. (PS: @Arnauld's JavaScript answer currently outputs f(x)g(y)zf(y)g(z)xf(z)g(x)y as well.)

When there is no operator, concatenation is actually the expected result, so you instead have to output like that.

Suggested test case: +»(x,y)(foo,bar,baz). I think baz should be ignored in that case, leading to foo(x)bar(y)+foo(y)bar(x). Could you please confirm that?

@Arnauld Hmm, that test case definitely fails right now for my program, regardless of what is intended (since it outputs as foo(x)bar(y)baz)+foo(y)bar(x)baz)+foo(x)bar(y)baz)..) Will try to fix it.

Also, what's the expected output for +«(x,y)(foo,bar,baz)? (@KevinCruijssen We do agree on that one, but I'm not 100% sure we're right.)

@Arnauld That's why I was asking for test cases with 3 or more function a few hours ago.. As for +«(x,y)(foo,bar,baz), I personally think it would output as foo(x)foo(y)+bar(x)bar(y)+baz(x)baz(y) (although my program currently outputs as foo(x)+foo(y)+bar(x)+bar(y)+baz(x)+baz(y).. >.>)

I don't find the "in the following method" descriptions clear enough to implement this or decide whether current answers are valid.

Can we use <,> instead of «,»?

@ChasBrown sure!

Another test case would be +»[f,g](x). What should result when there are more functions than variables?

@Jono2906 I still don't see any test cases with three or more functions.. What are the intended outputs for »+[f,g,h](x,y), «+[f,g,h](x,y), »+[f,g,h,i](x,y) and «+[f,g,h,i](x,y)? (And another suggested test case is one with an explicit * operator, and an output; since we have to remove them instead of joining by *.)

05AB1E, 63 bytes
UÇ`θiVεY€…(ÿ)«}ëDg©DIgα+>∍Œ®ùεζεðK'(ýyðå≠i')«]Dg≠iJ}¸˜Xý³gIg*Ā×

Four loose inputs in the order operator, direction, [variables], [functions].
Try it online or verify all test cases.
Explanation:
U                   # Pop and store the 1st (implicit) input `operator` in variable `X`
Ç                   # Convert the 2nd (implicit) input `direction` to a list of codepoint
 `                  # Push this codepoint to the stack
  θ                 # Only leave its last digit
   i                # If this digit is 1 (so the direction is "«"):
    V               #  Pop and store the 3rd (implicit) input `variables` in variable `Y`
    ε       }       #  Map over the 4th (implicit) input `functions`:
     Y              #   Push the `variable`-list from variable `Y`
      €…(ÿ)         #   Surround each variable with parenthesis
           «        #   And append it to the current `function` we're mapping
   ë                # Else (so the direction is "»" instead):
    D               #  Duplicate the 3rd (implicit) input `variables`
     g              #  Pop and push the length to get the amount of `variables`
      ©             #  Store it in variable `®` (without popping)
       D            #  Duplicate this length
        I           #  Push the fourth input `functions`
         g          #  Pop and take its length as well
          α         #  Take the absolute difference between the two amounts
           +        #  And add it to the duplicated amount of `variables`
            >       #  And increase it by 1
             ∍      #  Then extend the duplicated `variables` list to that length
    Œ               #  Get all sublists of this list
     ®ù             #  Only leave the sublists of a length equal to variable `®`
       ε            #  Map each remaining sublist to:
        ζ           #   Create pairs with the 4th (implicit) input `functions`,
                    #   with a default space as filler character if the lengths differ
         ε          #   Map each pair:
          ðK        #    Remove the spaces
          '(ý      '#    Join the pair with a ")" delimiter
          yðå≠i     #    If the current pair did NOT contain a space:
               ')« '#     Append a ")"
]                   # Close all open if-statements and maps
 D                  # Duplicate the resulting list
  g≠i }             # Pop and if its length is NOT 1:
     J              #  Join the inner-most list together to a string
       ¸            # Then wrap it into a list (in case it wasn't a list yet)
        ˜           # And deep flatten the list
         Xý         # Join it by the operator we stores in variable `X`
           ³g       # Get the length of the 3rd input-list `variables`
             Ig     # And the length of the 4th input-list `functions`
               *    # Multiply them with each other
                Ā   # Truthify it (0 remains 0; everything else becomes 1)
                 ×  # And repeat the string that many times
                    # (so it becomes an empty string if either list was empty,
                    #  or remains unchanged otherwise)
                    # (after which this is output implicitly as result)

NOTE: Currently fails for test cases with 3+ functions (in both directions) like »+[f,g,h](x,y) or «+[f,g,h](x,y). Will fix them and add the explanation after OP clarified what the intended output should be and some 3+ function test cases are added.

Like Arnauld's answer, your answer does not concatenate the expressions together with an empty string if the operator is * (source:when the operator is *, the expressions are simply concatenated without any symbols)

@EmbodimentofIgnorance You're right, noticed that as well. Should be straight-forward to fix. I'm still waiting for those test cases with 3 or more functions though, so I know what the intended solution should be for those before fixing everything.. >.>

JavaScript (ES6),  174  171 bytes
(d,o,f,v,g=(f,V=v)=>f?V.map(v=>f+`(${v})`):V)=>f+f&&v+v?(d<'»'?f[1]?f.map(f=>g(f).join``):g(f[0]):v.map((_,i)=>v.map((_,j)=>g(f[j],[v[i++%v.length]])).join``)).join(o):''

Try it online!
Commented
( d,                              // d   = direction
  o,                              // o   = operator
  f,                              // f[] = list of functions
  v,                              // v[] = list of variables
  g = (f, V = v) =>               // g = helper function taking (f, V[])
    f ?                           //   if f is defined:
      V.map(v =>                  //     for each variable v in V[]:
        f + `(${v})`              //       return f, followed by '(v)'
      )                           //
    :                             //   else:
      V                           //     just return V[] as-is
) =>                              //
  f + f && v + v ?                // if both f[] and v[] are non-empty:
    ( d < '»' ?                   //   if the direction is '«':
        f[1] ?                    //     if there are at least 2 functions:
          f.map(f =>              //       for each function f_i in f[]:
            g(f).join``           //         return 'f_i(v_0)f_i(v_1)...'
          )                       //       end of map()
        :                         //     else:
          g(f[0])                 //       return [ 'f_0(v_0)', 'f_0(v_1)', ... ]
      :                           //   else (the direction is '»'):
        v.map((_, i) =>           //     for each variable at position i:
          v.map((_, j) =>         //       for each variable at position j:
            g(                    //         return [ 'f_j(v_k)' ]
              f[j],               //         where k = i mod v.length
              [v[i++ % v.length]] //         and increment i
            )                     //
          ).join``                //       end of inner map(); join the list
        )                         //     end of outer map()
    ).join(o)                     //   join the final list with the operator
  :                               // else:
    ''                            //   just return an empty string

In the spec, it says when the operator is *, the expressions are simply concatenated without any symbols

170 bytes using ascii

representation (previous comment was too long to fit the whole text in)

Python 2, 179 190 194 bytes
lambda d,o,F,V,S='%s(%s)':(o*(o>'*')).join([(''.join(S%(u,v)for v in V)for u in F if V),(''.join(map(lambda u,v:v and u and S%(u,v)or v or'',F,(V+V)[i:i+len(V)]))for i in range(len(V)))][d>'<'])

Try it online!
11 bytes lost to fixing a bug.
A function that takes a direction, an operator, a list of functions, and a list of variables. For direction, uses <,> instead of «,» because utf-x reasons. This assumes that if the direction is >, and there are more functions than variables, that we ignore the excess function(s); e.g., >*[f,g,h],[c,d]) => f(c)g(d)*f(d)g(c)

Like Arnauld's answer, your answer does not concatenate the expressions together with an empty string if the operator is * (source:when the operator is *, the expressions are simply concatenated without any symbols)

@EmbodimentofIgnorance: Fixed

C# (Visual C# Interactive Compiler), 177 bytes
(d,o,f,v)=>string.Join(o=="*"?"":o,d<61?f.Select(l=>v.Aggregate("",(a,b)=>a+l+$"({b})")):v.Select((x,y)=>string.Concat(v.Select((i,o)=>o>=f.Count?i:f[(y+o)%f.Count]+$"({i})"))))

Try it online!


text:
ASCII Expansion
Introduction
Every number can be represented as ASCII. For example, \$0\$ comes in ASCII is \$48\$, \$1\$ is \$49\$, and so on. Using this method of translating numbers to other numbers, it is possible to infinitely expand a number, by replacing all its digits with their ASCII values and doing the same for the result. For example, if you started with \$0\$, you would expand to \$48\$, then to \$5256\$, and so on.
Challenge

You will be given a single digit and a number as input. You can assume the digit will be in the range \$0-9\$, or \$48-57\$ in ASCII. You can assume the digit will always be of length 1, and will be a string. The number will always be a positive integer, greater than -1. If it is 0, you do not expand at all. Other than that, there are no guarantees about its value. If, and only if your language has no method of input, you may store the input in two variables or in a list.
You must output the ASCII expansion of the digit if you expand it \$n\$ times, n being the number that was the input. If your language has no method of output, you may store it in a variable.

Example I/O

Digit = 0, N = 3
Output = 53505354
Digit = 2, N = 2
Output = 5348
Digit = 5, N = 0
Output = 5

Rules
This is code-golf, so shortest answer (in bytes) wins!

may we take the digit as a string?

@attinat "You can assume the digit will always be of length 1, and will be a string." Am I reading that wrong?

@HiddenBabel My own reading ability is the one that's questionable, apparently

in that case, what about the inverse - may we output or take input as numbers, rather than strings?

If, and only if your language has no method of input, you may store the input in two variables or in a list. What does that mean? And why not just rely on our default I/O methods?

BTW: Apart from that, this is a nicely written first challenge. :-)

Are only full programs allowed or is function acceptable too?

@val Functions are acceptable.

@attinat - the types of input are in the question, like HiddenBabel said.

Perl 6, 28 bytes
{($^a,*.ords.join...*)[$^b]}

Try it online!
Explanation:
{                          }  # Anonymous codeblock
 (               ...*)[$^b]   # Index into an infinite list
  $^a,                        # Starting from the given number
      *                       # Where each element is
       .ords.join             # The ordinal values joined

(As an aside, Perl 6 is now officially called Raku)

05AB1E, 3 bytes
FÇJ

Takes N as first input and the digit as second.
Try it online or verify all test cases.
Explanation:
F    # Loop the (implicit) first input (N) amount of times
 Ç   #  Convert the characters in the string at the top of the stack to its unicode values
     #  (which will take the second input implicitly in the first iteration)
  J  #  Join these unicode integers together to a single string
     # (after the loop, the result is output implicitly)

Python 2, 55 bytes
f=lambda s,n:f(`ord(s[0])`,n-1)+f(s[1:],n)if n*s else s

Try it online!

56 bytes
lambda s,n:eval("''.join(`ord(c)`for c in"*n+" s"+")"*n)

Try it online!
Generates and evaluates monstrosities like:
''.join(`ord(c)`for c in''.join(`ord(c)`for c in''.join(`ord(c)`for c in s)))

56 bytes
f=lambda s,n:s*0**n or''.join(`ord(c)`for c in f(s,n-1))

Try it online!

and...or saves a byte TIO

Brachylog, 7 bytes
{ṫạc}ⁱ⁾

Try it online!
{   }ⁱ     Repeat
 ṫ         stringifying,
  ạ        converting to a list of codepoints,
   c       and concatenating
      ⁾    a number of times equal to the last element of the input.

Huh, not sure I've ever had one of my answers downvoted before.

Jelly, 7 5 bytes
ṾOVƊ¡

Try it online!
-2 bytes after a friend helped me figure out what's wrong with O
For some reason, to run all test cases with a footer, an extra byte is required for the explicit ⁹ nilad: Try it online!
Ṿ        Stringify the input
 O       and convert each character to a codepoint,
  V      then concatenate them and eval the result,
   Ɗ¡    repeated a number of times equal to the right argument.

Nice.  Don't know Jelly, but does it help at all that you can take the input as a string?  I was wondering if you could somehow avoid the first step?

V turns it back into an integer anyhow, so the best I could do would probably just be to change the order of things, since using V to stringify and then concatenate the strings all in one byte seems like it ought to be optimal, even though it does end up with an integer.

J, 14 13 bytes
[:,":@u:~"+&3

Try it online!
How it works
The "bind" operator & is commonly used to bind a constant to a dyad, so that it can be used as a monad. However, the same form can be used as a dyad: x n&v y (where n is a noun and v is a dyadic verb) or x v&n y applies monadic n&v or v&n to y repeatedly x times. Using this feature, we can design the target function like this:
x some_constant&some_dyad y
run `some_constant some_dyad y` x times
... or ...
x some_dyad&some_constant y
run `y some_dyad some_constant` x times

In this case, there is an obvious choice for the some_constant, which is 3 for 3 u: y.
And here goes the full explanation:
[:,":@u:~"+&3
           &   Apply this function x times...
      u:~   3  Convert chars of y to ASCII values (3 u:)
   ":@   "+    Convert each number back to string
[:,            Flatten the array to get a single string

Ruby, 30 bytes
->s,n{n.times{s=s.bytes*''};s}

Try it online!

JavaScript (ES6),  43  40 bytes
Thanks to @tsh for reminding me that I didn't use currying this time :p (-3 bytes)
Takes input as (N)(digit).
n=>g=k=>n--?g(k.replace(/./g,c=>c^48)):k

Try it online!
How?
This is a simple recursive function. The only trick in there is c^48. Because c is a string, we need to coerce it to an integer. We could do +c+48, but that would be 1 byte longer. Using a bitwise XOR is safe here, as \$48\$ is \$110000_2\$ and c is less than \$10000_2\$.

I believe n=>g=k=>n--?g(k.replace(/./g,c=>c^48)):k is valid.

C# (.NET Core), 174 147 bytes
class Z{static void Main(string[] a){for(int n=int.Parse(a[1]);n-->0;){var x="";foreach(char c in a[0])x+=c-0;a[0]=x;}System.Console.Write(a[0]);}}

Big help from Jo King.
Try it online!
Ungolfed
class Z
{
   static void Main(string[] a)
    {
        int n = int.Parse(a[1]);
        for (; n-- > 0;)
        {
            var x = "";
            foreach (char c in a[0])
                x += c - 0; //c-0 gets converted to int, and then the int is
                                   //automatically converted to a string
            a[0]=x;
        }
        System.Console.Write(a[0]);
    }
}

@JoKing I thought of that first and somehow thought it was longer. But after all the substring business and calc'ing p that failed. Thanks!

foreach(char c in a[0]) -> foreach(var c in a[0]), -1  byte

Also, get rid of extra space in Main(string[] a)

Move the a[0]=x part into the top part of the for-loop, like this: for(int n=int.Parse(a[1]);n-->0;a[0]=x)

With using System.Linq; the inner part of the loop can be reduced to: a[0]=string.Concat(a[0].Select(c=>c-0));, -6 bytes

Python 2, 63 57 bytes
f=lambda i,n:n and f(''.join(`ord(c)`for c in i),n-1)or i

Try it online!
-6 bytes due to Jonathan Allan noting that the input can be a string.
Takes input as single digit string and an integer number of repetitions.

Take i as a string and save six bytes, TIO

@Jonathan Allan: Ah! I missed that that was permitted.

Haskell, 30 35 30 bytes
(!!).iterate(>>=show.fromEnum)

Try it online!
+5 then -5 bytes from Jo King clarifying the rules and then working it into pointfree.
My first Haskell golf so I've probably done something horribly wrong. In addition to having misspelled golf, I tried to import ord without putting it in my byte count!
    .                             The composition of
     iterate                      infinitely iterating, starting with the argument,
            (>>=             )    concatenating the results of mapping
                show              finding the string representation of
                    .fromEnum     the codepoint of the argument,
(!!)                              with indexing into the resulting infinite list.

You do have to import Data.char if you want to use ord. You can also do this in pointfree style for 30 bytes with fromEnum

Japt -h, 5 bytes
VÆ=mc

Try it
VÆ=mc   V = number of times, U = digit
VÆ      V times do: (Collects each result into an array)
  =mc     Map every digit of U to it's ASCII value, and make that the new U
-h      Take last element

Perl 5, 22 bytes
eval's/./ord$&/ge;'x<>

Try it online!

J, 18 bytes
([:,3":@u:"0])@[&0

Try it online!
From the J dictionary:

The phrase x f@[&0 y is equivalent to f^:x y , apply the monad f x times to y.

That is, it's a shortcut for power of ^: applied as many times as the left arg.  Which explains the
(  )@[&0

part of the code.  Now for what's in the parentheses:
3 u:] converts to a unicode code point, but unfortunately has infinite rank, and we want to apply it with 0 rank, hence the added "0.  The code point is a number, and we convert it back to a string with format ":.  Finally, we flatten , this list of strings.

Can you explain your code, I don't know what's going on. Thanks!

@GalenIvanov Done!

Thank you! Apparently I can't remember this shortcut to ^:

K (oK), 13 9 bytes
-4 bytes thanks to ngn
(,/$`i$)/

Try it online!

`(,/$`i$)/` works too, with swapped args

@ngn Thank you! Apparently I didn't know how x and y are applied to this tacit function.

PowerShell, 51 49 bytes
 -2 bytes thanks to mazzy
param($s,$n),1*$n|%{$s=-join($s|% t*y|%{+$_})};$s

Try it online!

Bracmat, 63 bytes
get':%?a %?n&whl'(!n+-1:~<0:?n&str$vap$((=.asc$!arg).!a):?a)&!a

Try it online!

Nice 1st answer. One suggestion is to add a Try It Online link in your answer so other users can easily verify your code. It's not required but highly recommended. It can also generate CG&CC posts which is nice.

Haskell, 30 bytes
(!!).iterate(show.fromEnum=<<)

Try it online!

I don't know Haskell, but there is already almost identical solution

@GalenIvanov The linked one does work exactly the same way as this one.

@GalenIvanov Yup, they're the same. I came up with it independently. Two same  answers isn't surprising here since I think it's the best Haskell can do.

Yes, it's not surprising to have this when the code is short :)

I was inspired to write mine entirely by just how perfect an application of the list monad it is, so it definitely makes sense that I'd not be alone in it

Charcoal, 9 bytes
ＦＮ≔⭆η℅κηη

Try it online! Link is to verbose version of code. Takes N as the first input and the digit as the second input. Explanation:
ＦＮ

Repeat N times...
≔⭆η℅κη

Map each character to its ordinal and concatenate.
η

Output the final result.
Sadly ＦＮ≦℅ηη doesn't work...

Lua, 55 bytes
a,N=...for i=1,N do a=a:gsub('.',('').byte)end
print(a)

Try it online!
Take input as arguments. Explanation is fairly obvious.
Alternative solution: Lua, 60 bytes
a,N=...for i=1,N do a=table.concat{a:byte(1,-1)}end
print(a)

Try it online!

QuadR, 8 bytes
Translation of Nahuel Fouilleul's solution. Thanks to Veskah for pointing it out.
.
⎕UCS⍵M

Try it online!
. replace any character
⎕UCS with the Universal Character Set ordinal of the
⍵M Match
This is equivalent to the Dyalog APL expression '.'⎕R{⍕⎕UCS⍵.Match}⍣⎕⊢⍞. Try it online!

Ooh nice! Works with 123456789 10 as well :D

Lua, 67 bytes
i=io.read d=i(1)for _=1,i()do
d=d:gsub(".",string.byte)end
print(d)

Try it online!
Let d be the digit we will transform (always of length 1, so we ask to read 1 character with io.read(1)).
If N > 0, replace each character by its byte value.
Return the digit.

Thunno 2, 3 bytes
{CJ

Try it online!
Explanation
{CJ  # Implicit input
{    # Repeat N times:
 C   #  Get ASCII codes
  J  #  Join into a string
     # Implicit output

Wolfram Language (Mathematica), 41 bytes
""<>ToString/@ToCharacterCode@#&~Nest~##&

Try it online!

APL (Dyalog Unicode), 16 bytes
{(∊⍕¨∘⎕UCS)⍣⍵⊢⍺}

Try it online!
Left input is a one-digit string, right input is the number of iteration. Returns the string representation of the result.
How it works
{(∊⍕¨∘⎕UCS)⍣⍵⊢⍺}
{              }  Dyadic dfn, ⍺=digit string, ⍵=iteration
             ⊢⍺   Start with ⍺
 (        )⍣⍵     Repeat ⍵ times...
      ⎕UCS        Convert each char to Unicode codepoint
   ⍕¨∘            Convert each number back to string
  ∊               Enlist (flatten) all chars into one string

-2 as full program.

PHP, 58 bytes
for([,$a,$b]=$argv;$b--;)$a=strtr($a,range(48,57));echo$a;

Try it online!
Input digit and number are two command arguments ($argv) in same order.
Comented
for(
  [,$a,$b]=$argv;  // $a is input digit and $b is number
  $b--;            // loop $b times
)
  $a=              // set $a to
    strtr(         // strtr in array mode, replaces keys with values
      $a,          // replace in $a itself
      range(48,57) // an array with keys 0...9 and values 48...57
    );
echo$a;            // at the end, output $a

C# (Visual C# Interactive Compiler), 55 bytes
a=>b=>{for(;b-->0;a=a.SelectMany(l=>l-0+""));return a;}

Try it online!

Python 3, 69 60 bytes
f=lambda n,i:i and f(''.join(str(ord(c))for c in n),i-1)or n

Try it online!

Icon, 72 63 bytes
Inspired by @xnor's Python 2 solution
procedure f(d,n)
return(*d*n<1&d)|f(48+!d,n-1)||f(d[2:0],n)
end

Try it online!

Red, 62 57 bytes
func[d n][loop n[parse d[any[change p: skip(0 + p/1)]]]d]

Try it online!
Explanation:
f: func [ d n ] [                  ; a function with 2 parameters
    loop n [                       ; repeat n times
        parse d [                  ; parse the string with the following rules
            any [                  ; one ore more
                change p: skip     ; change any string with length 1 (a single digit)
                (0 + p/1)          ; with its representation as a number 48..57
            ]
        ]
    ]
    d                              ; return the altered string
]

Retina, 21 bytes
.+¶

"$+"+`.
$.(*_48*

Try it online! Takes N as the first input and the digit as the second input. Explanation:
.+¶

Delete N from the output.
"$+"+`

Repeat N times.
.
$.(*_48*

Replace each digit with its ASCII code.

C (gcc), 88 bytes
Thanks ceilingcat and peter cordez for their contributions.
z(v,n){for(sprintf(o,"%d",v);n--;)for(strcpy(t,o),v=0;t[v];)sprintf(o+v++*2,"%d",t[v]);}

Try it online!

Maybe I'm missing something, but 11 is a shorter way to write the integer constant 2^9 aka 2 xor 9.  Are you sure you don't just want strcpy for an implicit-length string instead of a fixed-size 11 byte copy.

I made a mistake on that ^ operator.  Despite all my years in C every now and again I forget that ^ is not pow().  As for the strcpy, good catch.  Sometimes you get so caught up in old solutions you don't see the best way to write the current one.

Suggest v=!strcpy(t,o); instead of strcpy(t,o),v=0;

Zsh, 55 bytes
(($2*#1))&&<<<`$0 $[#1] $[$2-1]``$0 "${1:1}" $2`||<<<$1

Try it online!
A port of @xnor's Python 2 solution, it came in just two bytes below my first solution.
We require quotes around ${1:1}, otherwise it is removed when empty, turning $2 into $1 on the recursive call.

If the repeated expansion never grows past 2^63, 53 bytes with a recursive math function:
(){s=
for c (${(s::)1})s+=$[#c]
(($2?$0(s,$2-1):$1))}

Try it online!

dc, 64 bytes
dsi[A~48+lrZAr^*lr+srdZ1<P]sP[0srA*lPxlPxlrI3^/li1-dsi0<M]sM0<Mp

Try it online!
I wouldn't be surprised if I could golf this down a bit. It's more verbose than anticipated due to handling a lot of edge cases, etc. Put the 'digits' to transform on the stack first, then the number of iterations.
dsi stores the number of iterations in i. Macro P does one iteration of the transformation. A~ to divide w/ remainder by 10, 48+ to give us ASCII. Variable r holds our result. lrZAr^* loads this variable for the sake of finding how many digits it currently has. It shifts our ASCII value left (decimal) this many places (48 becomes 4800), then lr+sr adds our old value r and stores the result back into r. Here's tricky situation number one: dZ1<P says to keep running P as long as our source material is at least one digit. But, we need to do a final run when we hit 1 digit as well.
Macro M is our main. 0sr initializes r to 0, and then... the rest of this I'm going to explain a bit out of order. For each iteration, we need to run P twice, because of the aforementioned single-digit thing. So, lPxlPx. However, this screws us up when our original value is only a single digit. Plus, we often get left with an extra 0 at the right side. A* multiplies the original by ten, and I3^/ at the end divides by a thousand. This is pretty goofy, but it ensures all values work ok. li1-dsi0<M keeps running M until i, our number of iterations, is complete. We can't do dsMx as per usual to save & run a macro, because this won't work if our number of iterations is 0. So we test for that, leaving us with the longer sM0<M. Finally, we print.

Wren, 54 bytes
One iteration is simply x.bytes.join()....
Fn.new{|x,y|
for(i in 1..y)x=x.bytes.join()
return x
}

Try it online!

Vyxal, 5 bytes
(SCfṅ

Try it Online!
(     # Input times...
 S    # Stringify
  C   # Charcodes
   fṅ # Join together (Should just be ṅ, but bugs)

J-uby, 20 bytes
Takes curried arguments with \$n\$ first and \$digit\$ second, i.e. F[n][digit].
:**&(S|:bytes|:join)

Attempt This Online!
Explanation
The function S|:bytes|:join converts to a string, gets the character codes, then joins them. The :** operator applies that function \$n\$ times.

Setanta, 106 94 bytes
gniomh(d,n){le i idir(0,n){i=""le j idir(0,fad(d)){i+=go_teacs(48+go_uimh(d[j]))}d=i}toradh d}

Requires d to be passed in as a string.
Try it here!

V (vim), 20 bytes
ÀñÓ./½submatch(0)+48

Try it online!
Input is given as buffer input and an argument.  It runs :s/./\=submatch(0)+47/g the arg number of times

Racket, 110 bytes
(define(a x n)(if(< n 1)x(a(string->number(string-join(for/list([c(~a x)])(~a(char->integer c)))""))(- n 1))))

Try it online!
Also, as a bonus, it works with bigger numbers as well! For example: (a 11 3) and (a 123456789 10) (this gives a number with 9216 digits) are both valid inputs.

Explanation

We receive two inputs x (the number to expand) and n the number of expansions.

If n is less than 1, we return x as is.

We iterate through all the digits of x by converting x to a string. During each iteration, we obtain the string representation of each digit's ASCII value and append it to the list.

for/list handle all list appending for us, so all we need to do is return the string at the end of the iteration.

Once the list is obtained, we join it to a string without any spaces between all the values.

We convert the final string back into a number, pass it to step 1 as the new x and pass n - 1 as the n argument.

Repeat steps 1-5 until step 2 is executed.

(define (expand-to-ascii x n)
  (if (< n 1)
      x
      (a (string->number
           (string-join
             (for/list ([c (~a x)])
               (~a (char->integer c)))
             ""))
         (- n 1))))

Have an awesome week ahead!

Factor, 33 bytes
[ [ [ >dec ] map-concat ] times ]

Attempt This Online!

[ ... ] times call [ ... ] the number of times denoted by the number on top of the stack
[ >dec ] map-concat map over each character in a string, convert it to a string, and flatten

Gema, 57 characters
* *=@set{d;*}@repeat{*;@set{d;@x{$d}}}$d
x:?=@char-int{?}'

Sample run:
bash-5.0$ echo -n '0 3' | gema '* *=@set{d;*}@repeat{*;@set{d;@x{$d}}}$d;x:?=@char-int{?}'
53505354

Try it online!

Husk, 9 bytes
~!ȯ¡ṁosc→

Try it online!
Mostly a translation of the Haskell answer, with some combinator stuff thrown in to deal with 1-indexing.
 !           Index into
  ȯ¡         the infinite list of iterations of
    ṁ        concat-mapping
      s      show
     o       .
       c     ord
~            starting with the first argument, and with the index being the second argument
        →    incremented.

Ceylon, 75
String?x(String d,Integer n)=>loop(d)((s)=>"".join(s*.hash)).skip(n).first;

Try it online!
Here is the long version, which might be more understandable:
"""convert a string of digits (or other characters) into a string of the digits'
   ASCII values, represented themselves as decimal ASCII digits (without any
   separator).
"""
String asciify(String input) {
    // maps each character of the string into its ASCII value (actually unicode,
    // but that's the same for the relevant range), and this to decimal digits.
    {String*} asciiDecimals = input.map((Character c) => c.integer.string);
    // concatenate all those strings
    return String.sum(asciiDecimals);
}

"""expand a digit (or a string) into its ASCII representation several times."""
String asciiExpand(String digit, Integer times) {
    // infinite (lazy) list of all the expansions
    {String*} allExpansions = loop(digit)(asciify);
    // take the entry `times` steps from the first.
    return allExpansions.getFromFirst(times)
          // If that is null (which can't happen, as we have an infinite list),
          // throw an exception instead.
          else nothing;
}

Tricks used to make it shorter:

one-letter function and variable names
no comments/doc-strings
inline the intermediate {String*} variables
use the fat-arrow syntax (=>) instead of blocks with just one return for the functions
inline the asciify function → then we can use type interference, and don't need to write String again for parameter and return type
use "".join(...) instead of String.sum(...). Possibly a bit less efficient, but a slightly shorter (+ next point).
join takes an iterable of any objects, not just strings, and will apply .string on each element, so we don't need to write down .string ourselves.
use .hash instead of .integer to get the ASCII/Unicode values – Character's hash code happens to be implemented just the right way.
replace s.map((Character c)=>c.hash) with s*.hash (a spread attribute) – the first one is lazy (returns an iterable), the second one is non-lazy (returns a sequence – it's the equivalent for s.collect(...)), but this difference  doesn't matter here (as we join the strings shortly after anyways), and the second one is a lot shorter.
replace .getFromFirst(n) with the slightly shorter .skip(n).first. (This might get a different result for negative n, but those are outside of the specified input range anyways.)
instead of adding else nothing for the return (to convince the compiler that this is not nullable), we can just declare the nullable return type String?. It won't happen anyways for valid inputs.
remove non-essential whitespace

I also thought I found a shorter way of writing this (which works for finite iterables), but it actually doesn't work here, because loop returns an infinite iterable, and trying to convert it into a sequence (with [* ... ])will run forever until it runs out of memory:
String?y(String d, Integer n)=>[*loop(d)((s)=>"".join(s*.hash))][n];

Arturo, 46 bytes
$=>[&do.times:&->join to[:integer]to[:char]<=]

Try it!