Bc (programming language): Difference between revisions

Content deleted Content added
m Reverted edits by 110.227.245.205 (talk) (HG) (3.4.9)
Line 27:
 
==Implementations==
===POSIX Acbc===
The POSIX standardized acbc language is traditionally written as a program in the [[dc (computer program)|dc]] programming language to provide a higher level of access to the features of the dc language without the complexities of dc's terse syntax.
 
In this form, the acbc language contains single-letter [[variable (programming)|variable]], [[array data structure|array]] and [[function (programming)|function]] names and most standard arithmetic operators, as well as the familiar [[control-flow]] constructs (<code>'''if('''cond''')'''...</code>, <code>'''while('''cond''')'''...</code> and <code>'''for('''init''';'''cond''';'''inc''')'''...</code>) from C. Unlike C, an '''<code>if</code>''' clause may not be followed by an '''<code>else</code>'''.
 
Functions are defined using a '''<code>define</code>''' keyword, and values are returned from them using a '''<code>return</code>''' followed by the return value in parentheses. The '''<code>auto</code>''' keyword (optional in C) is used to declare a variable as local to a function.