Lesson 1 Introduction To C Programming
Lesson 1 Introduction To C Programming
Introduction to C
Programming
R.BISNAR
PROG1-INSTRUCTOR
What is C Programming
Language? Basics,
Introduction and
History
What is C programming?
❑ is a general-purpose programming language that is
extremely popular, simple and flexible.
❑ It is machine-independent, structured programming
language which is used extensively in various
applications.
❑ was the basics language to write everything from
operating systems (Windows and many others) to
complex programs like the Oracle database, Git,
Python interpreter and more.
What is C programming?
Structured language
❑It has the ability to divide and hide all the
information and instruction.
❑Code can be partitioned in C using functions or
code block.
❑C is a well structured language compare to other.
Features of C Program
General purpose language
❑ Make it ideal language for system programming.
❑ Itcan also be used for business and scientific
application.
❑ ANSI established a standard for c in 1983.
❑ The ability of c is to manipulate bits,byte and
addresses.
❑ It is adopted in later 1990.
Features of C Program
Portability
❑Portability is the ability to port or use the
software written .
❑One computer C program can be reused.
❑By modification or no modification.
Features of C Program
Code Re-usability & Ability to customize and extend
❑A programmer can easily create his own function
❑It can be used repeatedly in different application
❑C program basically collection of function
❑The function are supported by 'c' library
❑Function can be added to 'c' library continuously
Features of C Program
❑Compiler
❑Interpreter
❑Assembler
Following is the list of
popular compilers available
online:
❑ Clang compiler
❑MinGW compiler (Minimalist GNU
for Windows)
❑Portable 'C' compiler
❑Turbo C
Basic
Syntaxs
Tokens in C
C program consists of various tokens and a token
is either a keyword, an identifier, a constant, a
string literal, or a symbol.
Tokens in C
For example, the following C statement consists of
five tokens –
Semicolons
❑ is a statement terminator. That is, each
individual statement must be ended with a
semicolon. It indicates the end of one logical
entity.
Comments
❑ Comments are like helping text in your C program and they
are ignored by the compiler. They start with /* and terminate
with the characters */ as shown below −
❑ /* my first program in C */
❑ You cannot have comments within comments and they do not
occur within a string or character literals.
Identifiers
❑ A C identifier is a name used to identify a variable,
function, or any other user-defined item.
❑ An identifier starts with a letter A to Z, a to z, or an
underscore '_' followed by zero or more letters,
underscores, and digits (0 to 9).
❑ C does not allow punctuation characters such as @,
$, and % within identifiers.
❑ C is a case-sensitive programming language.
Thus, Manpower and manpower are two different
identifiers in C.
Identifiers
❑ Here are some examples of acceptable identifiers −
❑int - integer
❑char - character
❑float - float number
❑ double - long float
Common data types