Gw mau tau Contoh dari Bahasa pengaturcaraan B. Jelasin dalam bahasa melayu

Contoh berikut adalah dari Users' Reference to B oleh Ken Thompson:

/* The following function will print a non-negative number, n, to

the base b, where 2<=b<=10,  This routine uses the fact that

in the ASCII character set, the digits 0 to 9 have sequential

if(a=n/b) /* assignment, not test for equality */

printn(a, b); /* recursive */

The Development of the C Language, Dennis M. Ritchie. Puts B in the context of BCPL and C.

Users' Reference to B , Ken Thompson. Describes the PDP-11 version.

The Programming Language B , S. C. Johnson & B. W. Kernighan, Technical Report CS TR 8, Bell Labs (January 1973). The GCOS version on Honeywell equipment.