Definition

C Programming Language

C is a procedural (imperative) programming language. It is popular as an alternative to assembly language for writing highly efficient microcomputer programs.  It was designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support.

Unlike other general-purpose languages, it gives the programmer complete access to the machine’s internal (bit-by-bit) representation of all types of data. This makes it convenient to perform tasks that would ordinarily require assembly language, and to perform computations in the most efficient way of which the machine is capable.

There is a widespread (and often mistaken) belief that programs written in C are more efficient than programs written in any other language.

C programming language developed at Bell Laboratories in the 1970s, based on the two earlier languages B (1970) and BCPL (1967). A C compiler is provided as a part of the UNIX operating system (see UNIX), and C was used to write most of UNIX itself.

A C programm looks like - 

/* CHKSUM.C */
/* Sample program in C —M. Covington 1991 */
/* Based on a program by McLowery Elrod */
/* Reads a character string from the keyboard */
/* and computes a checksum for it. */

#include 
#define N 256
main()
{
	int i, n;
	char str[N];
	puts(”Type a character string:”);
	gets(str);
	printf(”The checksum is %d\n”,chksum(str));
}
chksum(s,n)
char* s;
int n;
{
	unsigned c;
	c = 0;
	while (n— >0) c = c + *s++;
	c = c % 256;
	return(c);
}
Share it:  Cite

More from this Section

  • C Programming Language
    C is a procedural (imperative) programming language. It is popular as an alternative to ...
  • Programming Language
    Programming Language is a language used to give instructions to computers. Which means ...
  • ASP (Active Server Pages)
    ASP (Active Server Pages) on Windows web servers, a system for generating web pages partly ...
  • Class
    A Class in object-oriented programming is a template or bluprint  that defines attributes ...
  • Computer Program
    ...