C Program Learning Part-1 - Engineer Simple

Search This Blog

C Program Learning Part-1

C Programming Overview

C Program Exercise Part-01

*ALGOL, root of all modern languages, introduced in the early 1960s. 

*In 1967, Martin Richards developed a language called BCPL (Basic Combined Programming Languages)used for writing system software.

*B was developed by Ken Thompson used to create UNIX operating system.


 

*Dennis Ritchie at Bell Laboratories C was created with the combination of ALGOL, BCPL and B.


Years

LanguageInventor

 1960

 ALGOL

 International Group

 1967

 BCPL

 Mertin Richards

 1970

 B

Ken Thompson

 1972

 Traditional C

 Dennis Ritchie

 1978

 K&R C

 Kerninghan and Ritchie

 1989

 ANSI

 ANSI Commitee

 1990

 ANSI/ISO C

 ISO Committee

 1999

 C99

 Standarization Comittee

Importance Of C 

*Rich set of built-in functions and operators to write complex program. 

*C compiler combines assembly language and High Level Languages. 

*C are efficient and fast. 

*32 key words and strength lies in its built-in functions. 

*C is highly portable. 

*C is well suited for structured programming. 

Sample Program: Printing a Message 

main() 

                   /*…. Printing begind….*/ 

                   printf(“I see, I remember,”); 

Out put: I see, I remember, 

Format of C Programming 

i. main() : Function name. It informs the system the name of the program is main and the execution begins at this line. 

ii. The opening brace “{” and the closing brace “}” contain the function body. Its contains a set of instructions to perform the given task. 

iii. C does not distinct between uppercase and lowercase letter. 

main()Function Name

{Start of Program

……………..Program Statement

……………… Each Statement must end with a semicolon (;)

}End of Program

The #define Directives

 A #define is a preprocessor compiler directive and not a statement. Therefore it should not end with a semicolon. This instructions usually placed at the beginning of the before the main() function.

Basic Structure of C Programs

Documentation Section 
Link Section
Definition Section 
Global Declaration Section 
main() function Section


Declaration Part

Execution Part


}

Subprogram Section 

Function 1

                 . User defined function

Function n

Executing a C Program 

*Creating the program
*Compiling the program 
*Linking the program with the functions that are needed from the C library 
*Executing the program.





Next Post Previous Post
No Comment
Add Comment
comment url