
Evolution and Applications of Programming in C
Explore the rich history and significance of programming in C from its inception in 1972 to its vital role in creating computer applications and software. Learn about its structured programming paradigm, portability, speed, and key elements such as tokens, keywords, and identifiers. Dive into the world of C, a middle-level language known for its simplicity and versatility.
Uploaded on | 0 Views
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
PROGRAMMING IN C PROGRAMMING IN C G.VINOTHINI MSC.,M.PHIL. DEPT OF INFORMATION TECHNOLOGY, BON SECOURS COLLEGE FOR WOMEN, THANJAVUR.
History of c. Introduction to c. Uses of c & importance of c. C tokens. Array, string, pointers. Structures and unions.
year 1960 1967 1970 1972 1978 1989 1990 1999 year language ALGOL BCPL B C K&RC ANSI C ANSI/ISO C99 language Developed by INTERNATIONL GROUP MARTIN RICHARDS KEN THOMPSON DENNIS RITCHIE KEMIGHAN &RITCHIE ANSI COMMITTEE ISO COMMITTEE STANDARDIZATION COMMITTEE Developed by
INTRODUCTION TO C INTRODUCTION TO C C is a structured programming language. C was originally developed in the 1972 by dennis ritchie at bell telephone laboratories. C is a high level language, which is developed for UNIX operating system. C is often called a middle level language because it combines the best element of low level language or machine level language with high level language.
C is used for creating computer application. Used in writing embedded software. Create compiler for different language. Implement different operating system.
Very simple language. Highly portable. Middle level language. Only 32 keywords so easy to make. Very fast execution speed.
Individual words and punctuation marks are called tokens. The smallest individual units are known as tokens C tokens constants 100 14.5 Keywords strings operators + - * / IJK Best float while identifiers Special symbols { } [ ] main amount
Every C word is classified as either a keyword or an identifier. All keywords have fixed meaning and these meaning cannot be changed. All keywords must be written in lowercase . auto break case char const continue default do double else enum signed size of static struct switch typedef union unsigned void volatile while extern float for goto if int long register return short
First character must be an alphabet (or underscore). Must consist of only letters , digits and underscore. Only first 31 characters are significant. Cannot use a keyword. Must not contain white space.
C refers to fixed values that do not change during the execution of a program constants Numeric character string single real int decimal fractional exponent octal Hexa decimal
Constant \a \b \f \n \r \t \v \ `\ ' \? \\ Constant meaning Alert Backspace Form feed New line Carriage return Horizontal tab Vertical tab Single quote Double quote Question mark backslash meaning
A variable is a data name that may be used to store a data value. A variable name can be chosen by the programmer in a meaningful way. a b c 5 14 19
They must begin with a letter. Uppercase and lowercase are significant. It should not be a keyword. White space is not allowed. Variable name First -tag char Variable name valid valid Not valid valid Remark Remark Char is a keyword Dollar sign is illegal Blank space is not permitted Keyword may be part of a name Price$ Not valid Group one Not valid Int_type valid
C language is rich in data types . A data type define as set of values and the operation that can be performed on them. Primary data types D A T A T Y P E S Derived data types User defined data types
Data types represent types of input to be carried in variable. 3.5 d 9 Float (number) Integer(number) character
primary Data type character integer float void char signed unsigned float signed un signed short double long char signed unsigned float signed int un signed short int double long int int int int short int long int short int long int double int int double long long
type Char or unsigned char Unsigned char Int or signed int Unsigned int Short int or signed short int Unsigned short int Long int or signed long int Unsigned long int Float type Size(bits) 8 Size(bits) range -128to 127 range 8 16 16 8 0 to 255 -32,768 to 32,767 0 to 65535 -128 to 127 8 32 O to 255 -2,147,483,648 to 2,147,483,647 0 to 4,294,967,295 3.4E-38 to 3.4E+38 1.7E-308 to 1.7E+308 3.4E 4932 to 32 32 Double 64 Long double 80
Stdio.h Conio.h String.h Math.h Graphic.h Dos.h Stdio.h Standard i/o header file Console i/o header file Collection of character make string Used to mathematic function Used to draw any shape Delay output Standard i/o header file
get char(): /read a character from keyboard. Put char(); character variable. get char() function is used to get getchar getchar(char); (char); put char () to output the values of putchar putchar(char); (char);
Printf() function is used to print the character string ,float , integer , octal and hexadecimal values on to the output screen. Printf() function with %d format specifier to display the value of integer variable. Scanf() function is used to read character, string, numeric data from a keyboard.
An array is a fixed size sequenced collection of elements of the same data type. An array is a group of related data items that shared a common name. ARRAYS TWO ONE MULTIDIMENSION AL ARRAYS DIMENSIONAL ARRAYS DIMENSIONAL ARRAYS
A pointer is derived data type in c Pointers contain memory addresses as their values. Pointers are more efficient in handling arrays and data tables. Pointers can be used to return multiple values from a function via function arguments. Pointers allow c to support dynamic memory management. Pointers reduce length and complexity of programs. They increase the execution speed and thus reduce the program execution time.
A String is a sequence of character that is treated as a single data items. Any group of characters(except double quote sign)define between double quotation marks is a string constant. Character strings are often used to build meaningful and readable function. char string char string- -name[size] name[size]
C library supports a large number of string handling function . Function Function action action Strcat() Concatenates two string Strcmp() Compare two strings Strcpy() Copies one string over another Finds the length of a string Strlen()
A structure in C is a collection of items of different types. A structure creates a data type that can be used to group items of possibility different types into a single type. struct keyword is used to create a structure. struct address { Char name[50]; Char street[100]; Char city[50]; Int pin; }
A union is a special data type . C allows to store different data types in the same memory location. Define a union with many members ,but only one member can contain a value at any given time. Union provide an efficient way of using the same memory location for multiple purpose.