Chapter 2 - C Programming Language
Chapter 2 - C Programming Language
Chapter 2 - C Programming Language
Key Terms
Program – an organized list of instructions that, when executed
causes the computer to behave in a predetermined manner.
Semantics - is a term for the ways that data and commands are presented.
Key Terms
Programming – is the implementation of logic to facilitate specified
computing operations and functionality.
Programming language semantics and syntax are used when constructing
a program.
Python
Java
C / C++
PHP
Swift
C#
Ruby
Objective – C
SQL
What is C Language?
is a general-purpose, procedural, imperative computer programming
language developed in 1972 by Dennis M. Ritchie, an American
computer scientist at the Bell Telephone Laboratories to develop the
UNIX operating system.
Execution Time
Embedded Programming
IDE Setup
Turbo C
Optional IDE
Code Blocks
Environment Setup
Turbo C - is an integrated development environment (IDE) and
compiler for programming in the C language. A tool for writing
programs in the C programming Language.
Functions
Variables
Comments
Structure of C Programs
A simple code that would print the words “Hello World”.
Structure of C Programs
Let us take a look at the various parts of the above program:
The first line of the program #include <stdio.h> is a preprocessor command or
header files, which tells a C compiler to include stdio.h file before going to actual
compilation.
The next line int main() is the main function where the program execution begins.
The next line /*...*/ will be ignored by the compiler and it has been put to add
additional comments in the program. So such lines are called comments in the
program.
The next line printf(...) is another function available in C which causes the message
"Hello, World!" to be displayed on the screen.
The next line return 0; terminates the main() function and returns the value 0.
Header Files
The files that are specified in the include section is called as
Preprocessor Command or commonly known as Header Files.
These are precompiled files that has some functions defined in them.
2 Types of Functions
1. Standard Library Functions
The standard library functions are built-in functions in C programming. These
Hence, to use the printf(..) function, we need to include the stdio.h header file
using #include <stdio.h>.
Functions
2. User – Defined Functions
program. These functions are made for code reusability and for