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 (20)

Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for university
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
 
C presentation
C presentationC presentation
C presentation
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Data type in c
Data type in cData type in c
Data type in c
 
C Language
C LanguageC Language
C Language
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
functions of C++
functions of C++functions of C++
functions of C++
 
History of c
History of cHistory of c
History of c
 
Presentation on C programming language
Presentation on C programming languagePresentation on C programming language
Presentation on C programming language
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
Strings in c++
Strings in c++Strings in c++
Strings in c++
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 

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

Udupi Call girl service 6289102337 Udupi escort service
Udupi Call girl service 6289102337 Udupi escort serviceUdupi Call girl service 6289102337 Udupi escort service
Udupi Call girl service 6289102337 Udupi escort servicemaheshsingh64440
 
Bhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL IN
Bhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL INBhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL IN
Bhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL INoyomaster143
 
Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7
Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7
Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7Sana Rajpoot
 
Call Girls In Saidpur Islamabad-->>03274100048 <<--
Call Girls In Saidpur Islamabad-->>03274100048 <<--Call Girls In Saidpur Islamabad-->>03274100048 <<--
Call Girls In Saidpur Islamabad-->>03274100048 <<--Ifra Zohaib
 
FARIDABAD CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
FARIDABAD CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICEFARIDABAD CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
FARIDABAD CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Rajkot Call Girls Contact Number +919358341802 Call Girls In Rajkot
Rajkot Call Girls Contact Number +919358341802 Call Girls In RajkotRajkot Call Girls Contact Number +919358341802 Call Girls In Rajkot
Rajkot Call Girls Contact Number +919358341802 Call Girls In RajkotSivanyaPandeya
 
Mysore Call girl service 6289102337 Mysore escort service
Mysore Call girl service 6289102337 Mysore escort serviceMysore Call girl service 6289102337 Mysore escort service
Mysore Call girl service 6289102337 Mysore escort servicemaheshsingh64440
 
Karachi Sexy Girls || 03280288848 || Sex services in Karachi
Karachi Sexy Girls || 03280288848 || Sex services in KarachiKarachi Sexy Girls || 03280288848 || Sex services in Karachi
Karachi Sexy Girls || 03280288848 || Sex services in KarachiAwais Yousaf
 
Kanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book now
Kanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book nowKanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book now
Kanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book nowapshanarani255
 
Kota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL IN
Kota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL INKota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL IN
Kota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL INoyomaster143
 
Indore ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book now
Indore  ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book nowIndore  ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book now
Indore ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book nowapshanarani255
 
Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7
Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7
Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7Sana Rajpoot
 
Digha Call Girl Service 97487*63073 Call Girls in Digha Escort service book...
Digha  Call Girl Service 97487*63073 Call Girls in Digha  Escort service book...Digha  Call Girl Service 97487*63073 Call Girls in Digha  Escort service book...
Digha Call Girl Service 97487*63073 Call Girls in Digha Escort service book...apshanarani255
 
Silchar Call Girl 97487*63073 Call Girls in Silchar Escort service book now
Silchar Call Girl 97487*63073 Call Girls in Silchar Escort service book nowSilchar Call Girl 97487*63073 Call Girls in Silchar Escort service book now
Silchar Call Girl 97487*63073 Call Girls in Silchar Escort service book nowapshanarani255
 
Guwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book now
Guwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book nowGuwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book now
Guwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book nowapshanarani255
 
Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...
Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...
Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...oyomaster143
 
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...oyomaster143
 
Kolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book now
Kolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book nowKolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book now
Kolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book nowapshanarani255
 
Chennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book now
Chennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book nowChennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book now
Chennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book nowapshanarani255
 
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...oyomaster143
 

Recently uploaded (20)

Udupi Call girl service 6289102337 Udupi escort service
Udupi Call girl service 6289102337 Udupi escort serviceUdupi Call girl service 6289102337 Udupi escort service
Udupi Call girl service 6289102337 Udupi escort service
 
Bhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL IN
Bhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL INBhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL IN
Bhopal ❤CALL GIRL 9874883814 ❤CALL GIRLS IN Bhopal ESCORT SERVICE❤CALL GIRL IN
 
Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7
Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7
Call Girls In Lahore || 03274100048 ||Lahore Call Girl Available 24/7
 
Call Girls In Saidpur Islamabad-->>03274100048 <<--
Call Girls In Saidpur Islamabad-->>03274100048 <<--Call Girls In Saidpur Islamabad-->>03274100048 <<--
Call Girls In Saidpur Islamabad-->>03274100048 <<--
 
FARIDABAD CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
FARIDABAD CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICEFARIDABAD CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
FARIDABAD CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Rajkot Call Girls Contact Number +919358341802 Call Girls In Rajkot
Rajkot Call Girls Contact Number +919358341802 Call Girls In RajkotRajkot Call Girls Contact Number +919358341802 Call Girls In Rajkot
Rajkot Call Girls Contact Number +919358341802 Call Girls In Rajkot
 
Mysore Call girl service 6289102337 Mysore escort service
Mysore Call girl service 6289102337 Mysore escort serviceMysore Call girl service 6289102337 Mysore escort service
Mysore Call girl service 6289102337 Mysore escort service
 
Karachi Sexy Girls || 03280288848 || Sex services in Karachi
Karachi Sexy Girls || 03280288848 || Sex services in KarachiKarachi Sexy Girls || 03280288848 || Sex services in Karachi
Karachi Sexy Girls || 03280288848 || Sex services in Karachi
 
Kanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book now
Kanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book nowKanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book now
Kanpur 💋 Call Girls 7870993772 Call Girls in Kanpur Escort service book now
 
Kota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL IN
Kota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL INKota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL IN
Kota ❤CALL GIRL 9874883814 ❤CALL GIRLS IN kota ESCORT SERVICE❤CALL GIRL IN
 
Indore ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book now
Indore  ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book nowIndore  ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book now
Indore ❣️Call Girl 97487*63073 Call Girls in Indore Escort service book now
 
Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7
Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7
Call Girls in Karachi || 03274100048 || 50+ Hot Sexy Girls Available 24/7
 
Digha Call Girl Service 97487*63073 Call Girls in Digha Escort service book...
Digha  Call Girl Service 97487*63073 Call Girls in Digha  Escort service book...Digha  Call Girl Service 97487*63073 Call Girls in Digha  Escort service book...
Digha Call Girl Service 97487*63073 Call Girls in Digha Escort service book...
 
Silchar Call Girl 97487*63073 Call Girls in Silchar Escort service book now
Silchar Call Girl 97487*63073 Call Girls in Silchar Escort service book nowSilchar Call Girl 97487*63073 Call Girls in Silchar Escort service book now
Silchar Call Girl 97487*63073 Call Girls in Silchar Escort service book now
 
Guwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book now
Guwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book nowGuwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book now
Guwahati ❣️ Call Girl 97487*63073 Call Girls in Guwahati Escort service book now
 
Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...
Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...
Pune ❤CALL GIRL 9874883814 ❤CALL GIRLS IN pune ESCORT SERVICE❤CALL GIRL IN We...
 
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
 
Kolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book now
Kolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book nowKolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book now
Kolkata 💋 Call Girl 9748763073 Call Girls in Kolkata Escort service book now
 
Chennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book now
Chennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book nowChennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book now
Chennai ❣️ Call Girl 97487*63073 Call Girls in Chennai Escort service book now
 
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
Nagpur ❤CALL GIRL 9874883814 ❤CALL GIRLS IN nagpur ESCORT SERVICE❤CALL GIRL I...
 

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.