SlideShare a Scribd company logo
1 of 29
C Programming language
Basic Concepts
Prepared By
The Smartpath Information systems
www.thesmartpath.in
Index
1. Brief History of C Language
2. About C Programming Language
3. Characteristics of C programming language
4 C Programming Environment
5. Installing C in Windows
6. C Program Structure
7. C Program Structure – Explained
8. C programming – Syntax
9. C Character Set
10 . Keywords
11. Operators in C
12. Operators in C ( continue…..)
Index
13. Data Types in C
14. Data Types in C
15. Data Types in C
16. Variables
17. Rules for Variable Declaration
18. Variables Scope
19. Input and Output
20 . Decision Making
21. Looping
22. Looping
23. C Libraries
24. Uses of C
Brief History of C Language
The origin of C is closely tied to the development of the UNIX operating
system, originally implemented in assembly language on a PDP-7 by
Ritchie and Thompson. The development of C started in 1972 on the
PDP-11 Unix system and first appeared in Version 2 Unix. In 1978, Brian
Kernighan and Dennis Ritchie published the first edition of The C
Programming Language. This book, known to C programmers as "K&R“.
ANSI –C - In 1990, the ANSI C standard (with formatting changes) was
adopted by the International Organization for Standardization (ISO) as
ISO/IEC 9899:1990, which is sometimes called C90. Therefore, the
terms "C89" and "C90" refer to the same programming language
About C Programming language
The C programming language is a structure oriented programming
language, developed at Bell Laboratories in 1972 by Dennis Ritchie
 C programming language features were derived from an earlier
language called “B” (Basic Combined Programming Language –
BCPL)
 C language was invented for implementing UNIX operating system
 In 1978, Dennis Ritchie and Brian Kernighan published the first
edition “The C Programming Language” and commonly known as
K&R C
 In 1983, the American National Standards Institute (ANSI)
established a committee to provide a modern, comprehensive
definition of C. The resulting definition, the ANSI standard
or “ANSI C”, was completed late 1988.
Characteristics of C programming language
 There is a small, fixed number of keywords, including a full set o flow of
control and primitive .
 There are a large number of arithmetical and logical operators, such as +,
+=, ++, &, ~, etc.
 Typing is static but weakly enforced all data has a type, but implicit
conversions can be performed; for instance, characters can be used as
integers.
 Strings are not a separate data type, but are conventionally implemented
As null terminated array of characters
 Enumerated are possible with the enum keyword. They are not tagged,
and are freely interconvertible with integers.
C programming Environment
The C programming environment consists of -
(1) Text Editor - Programs are typed in Text Editor . By default a new file
Noname.c is opened. Type your programs here , save it , compile and
run.
(2) Compiler – Compiler is a System software that is installed on computer
to compile and run programs. Most widely Turbo C compiler is used
Installing C in Windows
To install C in windows first download Turbo C compiler.
.
1. unzip the downloaded file. And run the install.exe file
2. Press ‘Enter’ to continue
3. Enter Source drive where C-compiler and editor will be saved.
4. Enter the source path to locate the exe file. Press ‘Enter’ key.
5. using arrow key , scroll down. Select start installation
6. A message is displayed after successful installation.
7. Go to C:TCBIN right click TC icon select create shortcut.
C Program Structure
A C program contains the following –
(a) preprocessor commands
(b) main( ) function
( c ) variables
(d) input and output functions
For example :
#include< stdio.h> /* this is comment line */
#include< conio.h>
Void main()
{
printf(“hello”);
getch();
}
C Program structure Explained
1. #include - The first two lines are preprocessor commands that tell the
compiler that the program is using functions in it.
2. Void main() - This is the main function. Program execution begins with the
this function only.
3. Variables - variables hold input and output values.
4. printf() - this is function to give output on the screen. The word “hello” is
displayed on output screen.
5. The getch() – It is a function that ends program and returns to program
window.
C Programming - Syntax for writing programs
1. C language is case sensitive language. Hello and hello are two different
words.
2. Programs are written in small caps only ie.. In small letters .Capital words
are treated differently.
3. Inside the main() function , each statement is terminated with semicolon.
4. Comments are used for explanation. /* ….. */ format is used to give
comments in program. They are not executed.
C Character Set
The basic C source character set includes the following characters
• Lowercase and uppercase letters: a–z , A–Z
• Decimal digits: 0–9
• Graphic characters: ! " # % & ' ( ) * + , - . / : ; < = > ? [  ] ^ _ { | } ~
• Whitespace characters – space , horizontal tab, vertical tab
new line , form feed
Keywords
Operators in C
C supports a rich set of operators, which are symbols used within an
expression to specify the manipulations to be performed while evaluating
that expression. C has operators for
1. Arithmetic operators 2. Relational operators
addition + Equals ==
subtraction - Not Equal !=
Multiplication * Greater than >
Division / Greater than equal to >=
Modulus % Less than <
Less than equal to <=
Operators in C
3 . Logical operators
logical AND && 8. function call ( )
logical OR || 9. object size sizeof( )
logical NOT !
10. Bitwise
4. increment ++ left shift <<
decrement -- right shift >>
5. Assignment operator =
6. Member selection . ->
Data Types in C
1. Basic data types
Data Type Format Specified Space occupied
char %c 1 byte
signed char %c 1 byte
int %d 2 bytes
signed short int %hi 2 bytes
long int %ld 4 bytes
float %f 4 bytes
double %lf 8 bytes
long double %Lf 10 bytes
Data Types in C
2. Derived data types -
The derived data types are
(i) Pointer
(ii) Array
(iii) Structure
(iv) Union
(v) Function
Data Types in C
3. User defined data types -
Typedef is used to create user defined data type in C
for example structures are declared with typedef to
create linked list data structures in C .
For Example :
typedef struct node
{
int n;
node * p;
}
Variables
Variables in C is valid name in the memory where input given by user is
stored and the result of program is stored. When a variable is declared
in program , it occupies space in memory according to its size. Such as
integer type takes 2 bytes of memory, char type takes 1 byte of memory
Example:
int sum;
float average;
char ch;
Here int ,float , char are basic data types.
And Sum , average and ch are variables.
.
Rules for declaring variables
1. A variable name should start with letter.
2. It should not be a keyword
3. It can contains underscore character.
4. It should not contain white spaces and special characters.
Example:
sum - valid
1sum - invalid
emp_id - valid
emp id - invalid
Variables scope
In C language variables have the following scopes
1. Local Scope - Variable declared inside main() , and variable declared
inside a function has local scope that is it is recognized inside it
local variable can be used inside that block of code.
2. Global Scope - variables declared outside the main() function are
global variable. They are recognized throughout the program.
They can be used by any function .
Input and output
C has functions predefined for taking user input in a program and giving output
in the screen
scanf( ) - the scanf() function takes variable number of arguments from user
in predefined format
format - scanf(“%d%c%f”, &a, &b, &c);
printf() - the printf() function gives output of program on the output screen
format - printf(“%d%c%f ” , a , b , c );
Decision making
Decision making requires that the programmer specify one or more
conditions to be evaluated or tested by the program, along with a statement
or statements to be executed if the condition is determined to be true, and
other statements to be executed if the condition is determined to be false
Statements used are -
1. simple if
2. if – else
3. if-else ladder
4. nested if – else
5. conditional operator
Decision making
Examples :
1. simple if
if( condition1)
{ statements; }
if(condition 2)
{statements ; }
2. if – else
if(condition true)
{ statements; }
else
{ condition false}
Looping
There may be a situation, when you need to execute a block of code several
number of times. In general, statements are executed sequentially: The first
statement in a function is executed first, followed by the second, and so on.
Statements inside the loop are executed till condition is true or condition gets
False. There are three types of loops in C
1. For Loop
2. While Loop
3. Do -While Loop
Looping
Examples :
1. For Loop
for(initialization ; condition; increm / decrem)
{ statements; }
2. While Loop
while(condition)
{ statements ;
}
3. Do -While Loop
do
{ statements
} while( condition );
C Libraries
C language contains set of files header files called library. These header files
Have ‘.h’ extension. They contain functions for various types of operations
Performed in a program. To use them we have to include them in a program
Through include statement. Some of C Library header files are –
stdio.h
conio.h
stdlib.h
graphics.h
Uses of C
C is widely used for "system programming", including implementing operating
systems and embedded system applications, due to a combination of
desirable characteristics such as code portability and efficiency, ability to
access specific hardware addresses, ability to match externally imposed
data access requirements, and low run-time demand on system resources.
C can also be used for website programming using CGI as a "gateway" for
information between the Web application, the server, and the browser Some
reasons for choosing C over interpreted languages are its speed, stability,
and near-universal availability C has also been widely used to implement
end-user applications, but much of that development has shifted to newer,
higher-level languages.
The smartpath information systems c pro

More Related Content

What's hot

Inline function
Inline functionInline function
Inline functionTech_MX
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programmingprogramming9
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 
Basic of the C language
Basic of the C languageBasic of the C language
Basic of the C languageSachin Verma
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityAakash Singh
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CSowmya Jyothi
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programmingTejaswiB4
 
Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming languageAbhishek Soni
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++amber chaudary
 
Functions in c language
Functions in c language Functions in c language
Functions in c language tanmaymodi4
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
 
Types of pointer in C
Types of pointer in CTypes of pointer in C
Types of pointer in Crgnikate
 
Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 

What's hot (20)

Inline function
Inline functionInline function
Inline function
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Basic of the C language
Basic of the C languageBasic of the C language
Basic of the C language
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and Associativity
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in C
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
enums
enumsenums
enums
 
Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming language
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 
Unit4
Unit4Unit4
Unit4
 
Type conversion
Type conversionType conversion
Type conversion
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
Types of pointer in C
Types of pointer in CTypes of pointer in C
Types of pointer in C
 
Function in c program
Function in c programFunction in c program
Function in c program
 

Viewers also liked

Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programmingSudheer Kiran
 
Devoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCDevoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCPhil Estes
 
Async Web Frameworks in Python
Async Web Frameworks in PythonAsync Web Frameworks in Python
Async Web Frameworks in PythonRyan Johnson
 
Sensor Localization presentation1&2
Sensor Localization  presentation1&2Sensor Localization  presentation1&2
Sensor Localization presentation1&2gamalsallam1989
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02Wingston
 
Vb.net session 15
Vb.net session 15Vb.net session 15
Vb.net session 15Niit Care
 
Part 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netGirija Muscut
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsWolfgang Stock
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3a_akhavan
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be SeenMark Pesce
 
What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++Microsoft
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.netGirija Muscut
 
Making Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignMaking Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignHubbard One
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.netGirija Muscut
 
Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Larry Nung
 

Viewers also liked (20)

bin'Abdullah_JACM 2015
bin'Abdullah_JACM 2015bin'Abdullah_JACM 2015
bin'Abdullah_JACM 2015
 
C language tutorial
C language tutorialC language tutorial
C language tutorial
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programming
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Devoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCDevoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runC
 
Async Web Frameworks in Python
Async Web Frameworks in PythonAsync Web Frameworks in Python
Async Web Frameworks in Python
 
Sensor Localization presentation1&2
Sensor Localization  presentation1&2Sensor Localization  presentation1&2
Sensor Localization presentation1&2
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
Vb.net session 15
Vb.net session 15Vb.net session 15
Vb.net session 15
 
Information Overload and Information Science / Mieczysław Muraszkiewicz
Information Overload and Information Science / Mieczysław MuraszkiewiczInformation Overload and Information Science / Mieczysław Muraszkiewicz
Information Overload and Information Science / Mieczysław Muraszkiewicz
 
Part 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.net
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be Seen
 
What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.net
 
Making Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignMaking Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information Design
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.net
 
Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Debugging in visual studio (basic level)
Debugging in visual studio (basic level)
 

Similar to The smartpath information systems c pro

Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Rohit Singh
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeksAashutoshChhedavi
 
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxIIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxrajkumar490591
 
Chapter 3(1)
Chapter 3(1)Chapter 3(1)
Chapter 3(1)TejaswiB4
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming LanguageProf Ansari
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxSanketShah544615
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptxVishwas459764
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1SURBHI SAROHA
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTBatra Centre
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentationnadim akber
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semKavita Dagar
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptxMugilvannan11
 

Similar to The smartpath information systems c pro (20)

Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)
 
UNIT 1 NOTES.docx
UNIT 1 NOTES.docxUNIT 1 NOTES.docx
UNIT 1 NOTES.docx
 
C programming.pdf
C programming.pdfC programming.pdf
C programming.pdf
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeks
 
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxIIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
 
Chapter 3(1)
Chapter 3(1)Chapter 3(1)
Chapter 3(1)
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming Language
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptx
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptx
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
 
C material
C materialC material
C material
 
C notes
C notesC notes
C notes
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
 
Basic c
Basic cBasic c
Basic c
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 

Recently uploaded

Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...
Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...
Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...aakahthapa70
 
8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi
8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi
8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhimonikaservice1
 
(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)
(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)
(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)riyaescorts54
 
Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712
Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712
Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712Delhi Escorts Service
 
9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...
9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...
9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...delhincr993
 
Call Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts Service
Call Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts ServiceCall Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts Service
Call Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts ServiceApsara Of India
 
Trusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂EscortsTrusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂EscortsLipikasharma29
 
BHOPAL CALL GIRL 92628*71154 BHOPAL CALL
BHOPAL CALL GIRL 92628*71154 BHOPAL CALLBHOPAL CALL GIRL 92628*71154 BHOPAL CALL
BHOPAL CALL GIRL 92628*71154 BHOPAL CALLNiteshKumar82226
 
Trusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂EscortsTrusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂EscortsLipikasharma29
 
9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCRthapariya601
 
Call Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCR
Call Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCRCall Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCR
Call Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCRsafdarjungdelhi1
 
Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)
Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)
Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)thapagita
 
(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR
(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR
(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCREscort Service
 
9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCRthapariya601
 
Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720
Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720
Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720Lipikasharma29
 
Call Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All Star
Call Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All StarCall Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All Star
Call Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All StarLipikasharma29
 
Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)
Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)
Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)ayushiverma1100
 
9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr
9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr
9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncrthapariya601
 
FULL ENJOY Call Girls In Gurgaon Call 8588836666 Escorts Service
FULL ENJOY Call Girls In Gurgaon  Call 8588836666 Escorts ServiceFULL ENJOY Call Girls In Gurgaon  Call 8588836666 Escorts Service
FULL ENJOY Call Girls In Gurgaon Call 8588836666 Escorts ServiceCALLGIRLS DELHI
 
9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCRthapariya601
 

Recently uploaded (20)

Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...
Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...
Call Girls In {Green Park Delhi} 9667938988 Indian Russian High Profile Girls...
 
8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi
8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi
8800357707, Munirka Metro Good Looking For Call Girls And Escort Service Delhi
 
(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)
(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)
(9818099198) Noida Escorts Service Sector 60 (NOIDA CALL GIRLS)
 
Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712
Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712
Call Girls In Sector 26, (Gurgaon) Call Us. 9711911712
 
9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...
9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...
9899855202 Call Girls In Goa This Ads Is Only For Those Clients Who Are Looki...
 
Call Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts Service
Call Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts ServiceCall Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts Service
Call Girls In Karnal 8860008073 Doorstep Sector 6 7 8 9 Karnal Escorts Service
 
Trusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂EscortsTrusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Shahdara Delhi ꧁❤ 9667422720 ❤꧂Escorts
 
BHOPAL CALL GIRL 92628*71154 BHOPAL CALL
BHOPAL CALL GIRL 92628*71154 BHOPAL CALLBHOPAL CALL GIRL 92628*71154 BHOPAL CALL
BHOPAL CALL GIRL 92628*71154 BHOPAL CALL
 
Trusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂EscortsTrusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂Escorts
Trusted Call~Girls In Rohini Delhi꧁❤ 9667422720 ❤꧂Escorts
 
9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Paschim Vihar Delhi NCR
 
Call Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCR
Call Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCRCall Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCR
Call Us ➥9911191017▻Young Call Girls In Guru Dronacharya Metro Station Delhi NCR
 
Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)
Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)
Call Us ☎97110√14705🔝 Call Girls In Mandi House (Delhi NCR)
 
(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR
(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR
(9599264170) ↫ Call Girls In Rk Puram ↫ Delhi NCR
 
9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Saket Metro Delhi NCR
 
Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720
Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720
Call Girls Near Sahara Mall, MG Road Gurgaon +91-9667422720
 
Call Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All Star
Call Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All StarCall Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All Star
Call Girls In indirapuram Ghaziabad ¶ 9667422720 ⎷ Delhi Escorts All Star
 
Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)
Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)
Call Us ≽ 9643900018 ≼ Call Girls In Lado Sarai (Delhi)
 
9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr
9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr
9643097474 Full Enjoy @24/7 Call Girls In Laxmi Nagar Delhi Ncr
 
FULL ENJOY Call Girls In Gurgaon Call 8588836666 Escorts Service
FULL ENJOY Call Girls In Gurgaon  Call 8588836666 Escorts ServiceFULL ENJOY Call Girls In Gurgaon  Call 8588836666 Escorts Service
FULL ENJOY Call Girls In Gurgaon Call 8588836666 Escorts Service
 
9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR
9643097474 Full Enjoy @24/7 Call Girls in Hauz Khas Delhi NCR
 

The smartpath information systems c pro

  • 1. C Programming language Basic Concepts Prepared By The Smartpath Information systems www.thesmartpath.in
  • 2. Index 1. Brief History of C Language 2. About C Programming Language 3. Characteristics of C programming language 4 C Programming Environment 5. Installing C in Windows 6. C Program Structure 7. C Program Structure – Explained 8. C programming – Syntax 9. C Character Set 10 . Keywords 11. Operators in C 12. Operators in C ( continue…..)
  • 3. Index 13. Data Types in C 14. Data Types in C 15. Data Types in C 16. Variables 17. Rules for Variable Declaration 18. Variables Scope 19. Input and Output 20 . Decision Making 21. Looping 22. Looping 23. C Libraries 24. Uses of C
  • 4. Brief History of C Language The origin of C is closely tied to the development of the UNIX operating system, originally implemented in assembly language on a PDP-7 by Ritchie and Thompson. The development of C started in 1972 on the PDP-11 Unix system and first appeared in Version 2 Unix. In 1978, Brian Kernighan and Dennis Ritchie published the first edition of The C Programming Language. This book, known to C programmers as "K&R“. ANSI –C - In 1990, the ANSI C standard (with formatting changes) was adopted by the International Organization for Standardization (ISO) as ISO/IEC 9899:1990, which is sometimes called C90. Therefore, the terms "C89" and "C90" refer to the same programming language
  • 5. About C Programming language The C programming language is a structure oriented programming language, developed at Bell Laboratories in 1972 by Dennis Ritchie  C programming language features were derived from an earlier language called “B” (Basic Combined Programming Language – BCPL)  C language was invented for implementing UNIX operating system  In 1978, Dennis Ritchie and Brian Kernighan published the first edition “The C Programming Language” and commonly known as K&R C  In 1983, the American National Standards Institute (ANSI) established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard or “ANSI C”, was completed late 1988.
  • 6. Characteristics of C programming language  There is a small, fixed number of keywords, including a full set o flow of control and primitive .  There are a large number of arithmetical and logical operators, such as +, +=, ++, &, ~, etc.  Typing is static but weakly enforced all data has a type, but implicit conversions can be performed; for instance, characters can be used as integers.  Strings are not a separate data type, but are conventionally implemented As null terminated array of characters  Enumerated are possible with the enum keyword. They are not tagged, and are freely interconvertible with integers.
  • 7. C programming Environment The C programming environment consists of - (1) Text Editor - Programs are typed in Text Editor . By default a new file Noname.c is opened. Type your programs here , save it , compile and run. (2) Compiler – Compiler is a System software that is installed on computer to compile and run programs. Most widely Turbo C compiler is used
  • 8. Installing C in Windows To install C in windows first download Turbo C compiler. . 1. unzip the downloaded file. And run the install.exe file 2. Press ‘Enter’ to continue 3. Enter Source drive where C-compiler and editor will be saved. 4. Enter the source path to locate the exe file. Press ‘Enter’ key. 5. using arrow key , scroll down. Select start installation 6. A message is displayed after successful installation. 7. Go to C:TCBIN right click TC icon select create shortcut.
  • 9. C Program Structure A C program contains the following – (a) preprocessor commands (b) main( ) function ( c ) variables (d) input and output functions For example : #include< stdio.h> /* this is comment line */ #include< conio.h> Void main() { printf(“hello”); getch(); }
  • 10. C Program structure Explained 1. #include - The first two lines are preprocessor commands that tell the compiler that the program is using functions in it. 2. Void main() - This is the main function. Program execution begins with the this function only. 3. Variables - variables hold input and output values. 4. printf() - this is function to give output on the screen. The word “hello” is displayed on output screen. 5. The getch() – It is a function that ends program and returns to program window.
  • 11. C Programming - Syntax for writing programs 1. C language is case sensitive language. Hello and hello are two different words. 2. Programs are written in small caps only ie.. In small letters .Capital words are treated differently. 3. Inside the main() function , each statement is terminated with semicolon. 4. Comments are used for explanation. /* ….. */ format is used to give comments in program. They are not executed.
  • 12. C Character Set The basic C source character set includes the following characters • Lowercase and uppercase letters: a–z , A–Z • Decimal digits: 0–9 • Graphic characters: ! " # % & ' ( ) * + , - . / : ; < = > ? [ ] ^ _ { | } ~ • Whitespace characters – space , horizontal tab, vertical tab new line , form feed
  • 14. Operators in C C supports a rich set of operators, which are symbols used within an expression to specify the manipulations to be performed while evaluating that expression. C has operators for 1. Arithmetic operators 2. Relational operators addition + Equals == subtraction - Not Equal != Multiplication * Greater than > Division / Greater than equal to >= Modulus % Less than < Less than equal to <=
  • 15. Operators in C 3 . Logical operators logical AND && 8. function call ( ) logical OR || 9. object size sizeof( ) logical NOT ! 10. Bitwise 4. increment ++ left shift << decrement -- right shift >> 5. Assignment operator = 6. Member selection . ->
  • 16. Data Types in C 1. Basic data types Data Type Format Specified Space occupied char %c 1 byte signed char %c 1 byte int %d 2 bytes signed short int %hi 2 bytes long int %ld 4 bytes float %f 4 bytes double %lf 8 bytes long double %Lf 10 bytes
  • 17. Data Types in C 2. Derived data types - The derived data types are (i) Pointer (ii) Array (iii) Structure (iv) Union (v) Function
  • 18. Data Types in C 3. User defined data types - Typedef is used to create user defined data type in C for example structures are declared with typedef to create linked list data structures in C . For Example : typedef struct node { int n; node * p; }
  • 19. Variables Variables in C is valid name in the memory where input given by user is stored and the result of program is stored. When a variable is declared in program , it occupies space in memory according to its size. Such as integer type takes 2 bytes of memory, char type takes 1 byte of memory Example: int sum; float average; char ch; Here int ,float , char are basic data types. And Sum , average and ch are variables. .
  • 20. Rules for declaring variables 1. A variable name should start with letter. 2. It should not be a keyword 3. It can contains underscore character. 4. It should not contain white spaces and special characters. Example: sum - valid 1sum - invalid emp_id - valid emp id - invalid
  • 21. Variables scope In C language variables have the following scopes 1. Local Scope - Variable declared inside main() , and variable declared inside a function has local scope that is it is recognized inside it local variable can be used inside that block of code. 2. Global Scope - variables declared outside the main() function are global variable. They are recognized throughout the program. They can be used by any function .
  • 22. Input and output C has functions predefined for taking user input in a program and giving output in the screen scanf( ) - the scanf() function takes variable number of arguments from user in predefined format format - scanf(“%d%c%f”, &a, &b, &c); printf() - the printf() function gives output of program on the output screen format - printf(“%d%c%f ” , a , b , c );
  • 23. Decision making Decision making requires that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and other statements to be executed if the condition is determined to be false Statements used are - 1. simple if 2. if – else 3. if-else ladder 4. nested if – else 5. conditional operator
  • 24. Decision making Examples : 1. simple if if( condition1) { statements; } if(condition 2) {statements ; } 2. if – else if(condition true) { statements; } else { condition false}
  • 25. Looping There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on. Statements inside the loop are executed till condition is true or condition gets False. There are three types of loops in C 1. For Loop 2. While Loop 3. Do -While Loop
  • 26. Looping Examples : 1. For Loop for(initialization ; condition; increm / decrem) { statements; } 2. While Loop while(condition) { statements ; } 3. Do -While Loop do { statements } while( condition );
  • 27. C Libraries C language contains set of files header files called library. These header files Have ‘.h’ extension. They contain functions for various types of operations Performed in a program. To use them we have to include them in a program Through include statement. Some of C Library header files are – stdio.h conio.h stdlib.h graphics.h
  • 28. Uses of C C is widely used for "system programming", including implementing operating systems and embedded system applications, due to a combination of desirable characteristics such as code portability and efficiency, ability to access specific hardware addresses, ability to match externally imposed data access requirements, and low run-time demand on system resources. C can also be used for website programming using CGI as a "gateway" for information between the Web application, the server, and the browser Some reasons for choosing C over interpreted languages are its speed, stability, and near-universal availability C has also been widely used to implement end-user applications, but much of that development has shifted to newer, higher-level languages.