SlideShare a Scribd company logo
 Introduction
 Evolution
 Characteristics
 Structure of program
 Input/output statements
 Command line arguments
 Escape sequences
12/11/2015
Session-1/Dr.M.karthika
2
Dennis M. Ritchie
 C language is one of the most popular
computer language
 structured ,
 low level ,
 machine dependent language
12/11/2015Session-1/Dr.M.karthika 4
 C programming language was developed in
1972 by Dennis Ritchie at bell laboratories of
AT&T(American Telephone & Telegraph),
located in U.S.A.
 It was developed to be used in UNIX
Operating system.
 It inherits many features of previous
languages such as B and BPCL.
12/11/2015Session-1/Dr.M.karthika 5
Language year Developed By
ALGOL 1960 International Group
BPCL 1967 Martin Richards
B 1970 Ken Thompson
Traditional C 1972 Dennis Ritchie
K & R C 1978 Kernighan & Dennis
Ritchie
ANSI C 1989 ANSI Committee
ANSI/ISO C 1990 ISO Committee
C99 1999 Standardization
Committee
 C is mother language of all programming
language.
 It is system programming language.
 It is procedure-oriented programming
language.
 It is also called mid level programming
language.
There are many features of c language are given below.
1) Simple
2) Machine Independent or Portable
3) Mid-level programming language
4) structured programming language
5) Rich Library
6) Memory Management
7) Fast Speed
8) Pointers
9) Recursion
10) Extensible
A sample C Program
#include<stdio.h>
int main()
{
--other statements
// Comments after double slash
}
Friday, December 11, 2015 9
 Type a program
 Save it
 Compile the program – This will generate an
exe file (executable)
 Run the program (Actually the exe created out
of compilation will run and not the .c file)
 In different compiler we have different option
for compiling and running. We give only the
concepts.
Friday, December 11, 2015 10
 #include <stdio.h> includes the standard input
output library functions.
 The printf() function is defined in stdio.h .
 #include <conio.h> includes the console input
output library functions.
 The getch() function is defined in conio.h file.
 void main() The main() function is the entry point
of every program in c language.
 The void keyword specifies that it returns no value.
 printf() The printf() function is used to print data on
the console.
 getch() The getch() function asks for a single
character. Until you press any key, it blocks the screen.
 The files that are specified in the include section
is called as header file
 These are precompiled files that has some
functions defined in them
 We can call those functions in our program by
supplying parameters
 Header file is given an extension .h
 C Source file is given an extension .c
 This is the entry point of a program
 When a file is executed, the start point is the
main function
 From main function the flow goes as per the
programmers choice.
 There may or may not be other functions
written by user in a program
 Main function is compulsory for any C program
 #include <stdio.h> includes the standard input
output library functions. The printf() function is defined
in stdio.h .
 #include <conio.h> includes the console input
output library functions. The getch() function is defined
in conio.h file.
 void main() The main() function is the entry point
of every program in c language. The void keyword
specifies that it returns no value.
 printf() The printf() function is used to print data on
the console.
 getch() The getch() function asks for a single
character. Until you press any key, it blocks the screen.
#include <stdio.h>
#include <conio.h>
void main(){
printf("Hello C Language");
getch();
}
Hello C Language
There are two input output function of c
language.
1) First is printf()
2) Second is scanf()
 printf() function is used for output.
It prints the given statement to the console.
 Syntax of printf() is given below:
printf(“format string”,arguments_list);
 Format string can be
%d (integer),
%c (character),
%s (string),
%f (float) etc.
12/11/2015Session-1/Dr.M.karthika 18
 scanf() Function: is used for input. It reads
the input data from console.
 scanf(“format string”,argument_list);
 Input
› scanf(“%d”,&a);
› Gets an integer value from the user and stores it
under the name “a”
 Output
› printf(“%d”,a);
› Prints the value present in variable a on the
screen
Friday, December 11, 2015 20
 Single line comment
› // (double slash)
› Termination of comment is by pressing enter key
 Multi line comment
/*….
…….*/
This can span over to multiple lines
Friday, December 11, 2015 21
12/11/2015Session-1/Dr.M.karthika 22
Constant Meaning
‘a’ Audible Alert (Bell)
‘b’ Back Space
‘f’ Form Feed
‘n’ New Line
‘r’ Carriage Return
‘t’ Horizontal Tab
‘v’ Vertical Tab
”’ Single Quote
‘”‘ Double Quote
‘?’ Question Mark
‘’ Backslash
‘0’ Null
Escape Sequences
 /* Testing the escape sequences */
#include <stdio.h>
int main(void)
{
printf("Testing the escape sequences:n");
printf("-----------------------------n");
/* 3 times audible tone */
printf("The audible bell ---> a aaan");
printf("The backspace ---> b___ bTestingn");
/* printer must be attached...*/
printf("The formfeed, printer ---> f fTestn");
printf("The newline ---> n nn");
printf("The carriage return ---> r rTestingrn");
printf("The horizontal tab ---> t tTestingtn");
printf("The vertical tab ---> v Testingvn");
printf("The backslash --->  Testingn");
printf("The single quote ---> ' 'Testing'''n");
printf("The double quote ---> " "Testing""n");
printf("Some might not work isn't it?n");
return 0;
}
 Output example:
Testing the escape sequences:
-----------------------------
The audible bell ---> a
The backspace ---> b___Testing
The formfeed, printer ---> f ?Test
The newline ---> n
Testingriage return ---> r
The horizontal tab ---> t Testing
The vertical tab ---> v Testing?
The backslash --->  Testing
The single quote ---> ' 'Testing' ' '
The double quote ---> " "Testing""
Some might not work isn't it?
Press any key to continue . . .
12/11/2015Session-1/Dr.M.karthika 23
12/11/2015Session-1/Dr.M.karthika 24
12/11/2015Session-1/Dr.M.karthika 25

More Related Content

What's hot

Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
TejaswiB4
 
C tokens
C tokensC tokens
C tokens
Manu1325
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
Muthuganesh S
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
Sathish Narayanan
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
Tarun Sharma
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
Ashim Lamichhane
 
History of c
History of cHistory of c
History of c
Shipat Bhuiya
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
Rigvendra Kumar Vardhan
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
Rokonuzzaman Rony
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
Sokngim Sa
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
v_jk
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
tanmaymodi4
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
Leela Koneru
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Manoj Tyagi
 
C program
C programC program
C program
AJAL A J
 

What's hot (20)

C PROGRAMMING
C PROGRAMMINGC PROGRAMMING
C PROGRAMMING
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
C tokens
C tokensC tokens
C tokens
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 
History of c
History of cHistory of c
History of c
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C program
C programC program
C program
 

Viewers also liked

Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
avikdhupar
 
Dose baixa versus dose elevada
Dose baixa versus dose elevadaDose baixa versus dose elevada
Dose baixa versus dose elevada
MediTec Group AB FerroCare Division
 
Chapter 5:Understanding Variable Scope and Class Construction
Chapter 5:Understanding Variable Scope and Class ConstructionChapter 5:Understanding Variable Scope and Class Construction
Chapter 5:Understanding Variable Scope and Class Construction
It Academy
 
Program Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State UniversityProgram Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State University
Reggie Niccolo Santos
 
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and RefinementGoal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Emil Lupu
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and Associativity
Aakash Singh
 
Model Evolution Workshop at MODELS 2010
Model Evolution Workshop at MODELS 2010Model Evolution Workshop at MODELS 2010
Model Evolution Workshop at MODELS 2010Matthias Biehl
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1Jomel Penalba
 
Escape sequences
Escape sequencesEscape sequences
Escape sequences
Way2itech
 
Storage classes
Storage classesStorage classes
Storage classes
Leela Koneru
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
Rakesh Roshan
 
Presentation influence texture or crystallography orientations on magnetic pr...
Presentation influence texture or crystallography orientations on magnetic pr...Presentation influence texture or crystallography orientations on magnetic pr...
Presentation influence texture or crystallography orientations on magnetic pr...
aftabgardon
 
Storage classes
Storage classesStorage classes
Storage classes
Puneet Rajput
 
C pointers
C pointersC pointers
C pointers
Aravind Mohan
 
Coper in C
Coper in CCoper in C
Coper in C
thirumalaikumar3
 
The 8 different sub disciplines of urology
The 8 different sub disciplines of urologyThe 8 different sub disciplines of urology
The 8 different sub disciplines of urology
Health First
 
Bespoke glasses | Cool Eyewear
Bespoke glasses | Cool EyewearBespoke glasses | Cool Eyewear
Bespoke glasses | Cool Eyewear
Mono Qool
 
exhibitions,event planning,designers,events management,companies,contractors
exhibitions,event planning,designers,events management,companies,contractorsexhibitions,event planning,designers,events management,companies,contractors
exhibitions,event planning,designers,events management,companies,contractors
exhibithire
 

Viewers also liked (20)

Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
Dose baixa versus dose elevada
Dose baixa versus dose elevadaDose baixa versus dose elevada
Dose baixa versus dose elevada
 
Chapter 5:Understanding Variable Scope and Class Construction
Chapter 5:Understanding Variable Scope and Class ConstructionChapter 5:Understanding Variable Scope and Class Construction
Chapter 5:Understanding Variable Scope and Class Construction
 
10. Function I
10. Function I10. Function I
10. Function I
 
Program Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State UniversityProgram Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State University
 
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and RefinementGoal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and Associativity
 
Model Evolution Workshop at MODELS 2010
Model Evolution Workshop at MODELS 2010Model Evolution Workshop at MODELS 2010
Model Evolution Workshop at MODELS 2010
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1
 
Typecasting in c
Typecasting in cTypecasting in c
Typecasting in c
 
Escape sequences
Escape sequencesEscape sequences
Escape sequences
 
Storage classes
Storage classesStorage classes
Storage classes
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Presentation influence texture or crystallography orientations on magnetic pr...
Presentation influence texture or crystallography orientations on magnetic pr...Presentation influence texture or crystallography orientations on magnetic pr...
Presentation influence texture or crystallography orientations on magnetic pr...
 
Storage classes
Storage classesStorage classes
Storage classes
 
C pointers
C pointersC pointers
C pointers
 
Coper in C
Coper in CCoper in C
Coper in C
 
The 8 different sub disciplines of urology
The 8 different sub disciplines of urologyThe 8 different sub disciplines of urology
The 8 different sub disciplines of urology
 
Bespoke glasses | Cool Eyewear
Bespoke glasses | Cool EyewearBespoke glasses | Cool Eyewear
Bespoke glasses | Cool Eyewear
 
exhibitions,event planning,designers,events management,companies,contractors
exhibitions,event planning,designers,events management,companies,contractorsexhibitions,event planning,designers,events management,companies,contractors
exhibitions,event planning,designers,events management,companies,contractors
 

Similar to C basics

Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
farishah
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
SURBHI SAROHA
 
What is turbo c and how it works
What is turbo c and how it worksWhat is turbo c and how it works
What is turbo c and how it works
Mark John Lado, MIT
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
sanjay joshi
 
Programming in c
Programming in cProgramming in c
Programming in c
Ashutosh Srivasatava
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
RohitRaj744272
 
C_Intro.ppt
C_Intro.pptC_Intro.ppt
C_Intro.ppt
gitesh_nagar
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
skashwin98
 
C structure
C structureC structure
C structure
ankush9927
 
Chapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxChapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptx
Abdalla536859
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
Mithun DSouza
 
Unit 1 c - all topics
Unit 1   c - all topicsUnit 1   c - all topics
Unit 1 c - all topics
veningstonk
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
Kavita Dagar
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYRajeshkumar Reddy
 
C language tutorial
C language tutorialC language tutorial
C language tutorial
Jitendra Ahir
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
aaravSingh41
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
sanjay joshi
 
Overview of c
Overview of cOverview of c
Overview of c
Chandrapriya Rediex
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
atulchaudhary821
 

Similar to C basics (20)

Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
What is turbo c and how it works
What is turbo c and how it worksWhat is turbo c and how it works
What is turbo c and how it works
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
 
Programming in c
Programming in cProgramming in c
Programming in c
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
 
C_Intro.ppt
C_Intro.pptC_Intro.ppt
C_Intro.ppt
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
 
C structure
C structureC structure
C structure
 
Chapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxChapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptx
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
Unit 1 c - all topics
Unit 1   c - all topicsUnit 1   c - all topics
Unit 1 c - all topics
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
 
C language tutorial
C language tutorialC language tutorial
C language tutorial
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
 
Overview of c
Overview of cOverview of c
Overview of c
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
 

More from thirumalaikumar3

Data type in c
Data type in cData type in c
Data type in c
thirumalaikumar3
 
Control flow in c
Control flow in cControl flow in c
Control flow in c
thirumalaikumar3
 
C function
C functionC function
C function
thirumalaikumar3
 
Structure c
Structure cStructure c
Structure c
thirumalaikumar3
 
String c
String cString c
File handling in c
File  handling in cFile  handling in c
File handling in c
thirumalaikumar3
 
File handling-c programming language
File handling-c programming languageFile handling-c programming language
File handling-c programming language
thirumalaikumar3
 
Data type2 c
Data type2 cData type2 c
Data type2 c
thirumalaikumar3
 

More from thirumalaikumar3 (8)

Data type in c
Data type in cData type in c
Data type in c
 
Control flow in c
Control flow in cControl flow in c
Control flow in c
 
C function
C functionC function
C function
 
Structure c
Structure cStructure c
Structure c
 
String c
String cString c
String c
 
File handling in c
File  handling in cFile  handling in c
File handling in c
 
File handling-c programming language
File handling-c programming languageFile handling-c programming language
File handling-c programming language
 
Data type2 c
Data type2 cData type2 c
Data type2 c
 

Recently uploaded

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 

Recently uploaded (20)

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 

C basics

  • 1.
  • 2.  Introduction  Evolution  Characteristics  Structure of program  Input/output statements  Command line arguments  Escape sequences 12/11/2015 Session-1/Dr.M.karthika 2
  • 4.  C language is one of the most popular computer language  structured ,  low level ,  machine dependent language 12/11/2015Session-1/Dr.M.karthika 4
  • 5.  C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T(American Telephone & Telegraph), located in U.S.A.  It was developed to be used in UNIX Operating system.  It inherits many features of previous languages such as B and BPCL. 12/11/2015Session-1/Dr.M.karthika 5
  • 6. Language year Developed By ALGOL 1960 International Group BPCL 1967 Martin Richards B 1970 Ken Thompson Traditional C 1972 Dennis Ritchie K & R C 1978 Kernighan & Dennis Ritchie ANSI C 1989 ANSI Committee ANSI/ISO C 1990 ISO Committee C99 1999 Standardization Committee
  • 7.  C is mother language of all programming language.  It is system programming language.  It is procedure-oriented programming language.  It is also called mid level programming language.
  • 8. There are many features of c language are given below. 1) Simple 2) Machine Independent or Portable 3) Mid-level programming language 4) structured programming language 5) Rich Library 6) Memory Management 7) Fast Speed 8) Pointers 9) Recursion 10) Extensible
  • 9. A sample C Program #include<stdio.h> int main() { --other statements // Comments after double slash } Friday, December 11, 2015 9
  • 10.  Type a program  Save it  Compile the program – This will generate an exe file (executable)  Run the program (Actually the exe created out of compilation will run and not the .c file)  In different compiler we have different option for compiling and running. We give only the concepts. Friday, December 11, 2015 10
  • 11.  #include <stdio.h> includes the standard input output library functions.  The printf() function is defined in stdio.h .  #include <conio.h> includes the console input output library functions.  The getch() function is defined in conio.h file.  void main() The main() function is the entry point of every program in c language.  The void keyword specifies that it returns no value.  printf() The printf() function is used to print data on the console.  getch() The getch() function asks for a single character. Until you press any key, it blocks the screen.
  • 12.  The files that are specified in the include section is called as header file  These are precompiled files that has some functions defined in them  We can call those functions in our program by supplying parameters  Header file is given an extension .h  C Source file is given an extension .c
  • 13.  This is the entry point of a program  When a file is executed, the start point is the main function  From main function the flow goes as per the programmers choice.  There may or may not be other functions written by user in a program  Main function is compulsory for any C program
  • 14.  #include <stdio.h> includes the standard input output library functions. The printf() function is defined in stdio.h .  #include <conio.h> includes the console input output library functions. The getch() function is defined in conio.h file.  void main() The main() function is the entry point of every program in c language. The void keyword specifies that it returns no value.  printf() The printf() function is used to print data on the console.  getch() The getch() function asks for a single character. Until you press any key, it blocks the screen.
  • 15. #include <stdio.h> #include <conio.h> void main(){ printf("Hello C Language"); getch(); }
  • 17. There are two input output function of c language. 1) First is printf() 2) Second is scanf()
  • 18.  printf() function is used for output. It prints the given statement to the console.  Syntax of printf() is given below: printf(“format string”,arguments_list);  Format string can be %d (integer), %c (character), %s (string), %f (float) etc. 12/11/2015Session-1/Dr.M.karthika 18
  • 19.  scanf() Function: is used for input. It reads the input data from console.  scanf(“format string”,argument_list);
  • 20.  Input › scanf(“%d”,&a); › Gets an integer value from the user and stores it under the name “a”  Output › printf(“%d”,a); › Prints the value present in variable a on the screen Friday, December 11, 2015 20
  • 21.  Single line comment › // (double slash) › Termination of comment is by pressing enter key  Multi line comment /*…. …….*/ This can span over to multiple lines Friday, December 11, 2015 21
  • 22. 12/11/2015Session-1/Dr.M.karthika 22 Constant Meaning ‘a’ Audible Alert (Bell) ‘b’ Back Space ‘f’ Form Feed ‘n’ New Line ‘r’ Carriage Return ‘t’ Horizontal Tab ‘v’ Vertical Tab ”’ Single Quote ‘”‘ Double Quote ‘?’ Question Mark ‘’ Backslash ‘0’ Null Escape Sequences
  • 23.  /* Testing the escape sequences */ #include <stdio.h> int main(void) { printf("Testing the escape sequences:n"); printf("-----------------------------n"); /* 3 times audible tone */ printf("The audible bell ---> a aaan"); printf("The backspace ---> b___ bTestingn"); /* printer must be attached...*/ printf("The formfeed, printer ---> f fTestn"); printf("The newline ---> n nn"); printf("The carriage return ---> r rTestingrn"); printf("The horizontal tab ---> t tTestingtn"); printf("The vertical tab ---> v Testingvn"); printf("The backslash ---> Testingn"); printf("The single quote ---> ' 'Testing'''n"); printf("The double quote ---> " "Testing""n"); printf("Some might not work isn't it?n"); return 0; }  Output example: Testing the escape sequences: ----------------------------- The audible bell ---> a The backspace ---> b___Testing The formfeed, printer ---> f ?Test The newline ---> n Testingriage return ---> r The horizontal tab ---> t Testing The vertical tab ---> v Testing? The backslash ---> Testing The single quote ---> ' 'Testing' ' ' The double quote ---> " "Testing"" Some might not work isn't it? Press any key to continue . . . 12/11/2015Session-1/Dr.M.karthika 23

Editor's Notes

  1. Format specifiers %d is the format specifier. This informs to the compiler that the incoming value is an integer value. Other data types can be specified as follows: %c – character %f – float %lf – double %s – character array (string) Printf and scanf are defined under the header file stdio.h