History of C Language
History of C language is interesting to know. Here we are going to discuss brief history of c language.
C is an imperative procedural language.C is a general-purpose language which has been closely associated with the UNIX operating system for which it was developed - since the system and most of the programs that run it are written in C.
C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A.
C was developed at Bell Laboratories as a system programming language to implement a new operating system on a DEP PDP-11 minicomputer. The project began in 1972, and a language description was published six years later (Kernighan and Ritchie, 1978) [C is a compact terse programming language that includes data types, data separations, the ability to manipulate addresses, and uncomplicated but complete set of flow control constructions.
Dennis Ritchie is known as the founder of c language.
Many of its principles and ideas were taken from the earlier language B and B's earlier ancestors BCPL and CPL. CPL ( Combined Programming Language ) was developed with the purpose of creating a language that was capable of both high level, machine independent programming and would still allow the programmer to control the behavior of individual bits of information
How to Variables Declare
Variable Declaration
Usually Variables are declared before use either at the start of a block of code after the opening {and before any other statements or outside a function.
-------------------------------------------------------------------------------------------------------------------------------------------------int a,b;/*global variables*/
main()
{
float a;/*local variables
}
--------------------------------------------------------------------------------------------------------------------------------------------------
Local variables can only accessed within that function only whereas Global variables can access in whole program.
Variable Types
There are many 'built-in' data types in C.
short int -128 to 127 (1 Byte)
unsigned short int 0 to 255 (1 Byte)
char 0 to 255 or -128 to 127 (1 Byte)
v
Unsigned char 0 to 255 (1 Byte)
signed char-128 to 127 (1 Byte)
int -32,768 to +32,767 (2 Byte)
unsigned int 0 to +65,535 (2 Bytes)
long int -2,147,483,648 to +2,147,483,647 (4 bytes)
unsigned long int 0 to 4,294,967,295 (4 Byte)
double double precision floating point (8 Byte)
long double extended precision floating point(10 Bytes)
Variable Names
we can use any combination of letters and numbers for Variables and function names but it must start with a letter.
We can use Underscore (_) as a letter in variable name and can begin with an underscore But Identifiers beginning with an underscore are reserved, And identifiers beginning with an underscore followed by a lower case letter are reserved, for file scope identifiers Therefore using
Underscore as starting letter is not desirable.
Piku and piku are different identifiers because upper and lower case letters are treated as different identifiers.
Comments
Post a Comment
Thank you for comment.