SlideShare a Scribd company logo
Lecture 2
Programming in C language
VIDYA CLASSES
Asstt. Professor
Department of computer science and IT
Introduction of c
• In 1960 B language (Basic combined programming language)
was developed
• Modified by DENNIS RITCHIE at bell laboratories in 1972
Importance of c
• It is strong language whose functions and operators can be used to write
any complex program
• Programs written in c are efficient and fast due to it’s variety of data
types and powerful operators. It is many time faster than basic
• In c many standard functions are available which can be used for
developing programs
• C is highly portable it means that c programs written for one computer can
be run for another
• Basically c is collection of function that are supported by c library .We can
continuously add our own functions to the c library so it’s ability to extend
itself
Basic Structure of c Program
Documentation Section
Documentation Section
Link section
Defination Section
Global Declaration Section
Main() Function Section
{
Declaration part
Executable part
}
Subprogram Section
Fun 1
Fun 2
.
.
.
Fun 4
eg.
/* To find circumfarance of circle*/
#include<stdio.h>
#include<conio.h>
# define pi 3.14
main()
{
float c,r=5;
c=2*pi*r;
printf(“circumfarance=%f”,c);
getch();
}
Character Set
• Letter
Uppercase A……Z
Lowercase a….z
• Digits
0…..9
• Special Character
Comma,colon,question mark
• White Space
Blank space,horizontal tab,newline
Tockens in C
Smallest individual units are called tockens .Their are 6
types of tockens
• Keywords
eg. Auto , char
• No to identifiers
eg. A(n),B(n),name,variable,function
• Constants
eg.50,-23.7
• String
eg. “kalyan”, “data”
• Special Symbol
eg.{},[],#
• Operators
eg. +,-,*
Executing a c program
• Creating the program
• Compiling the program
• Linking the program with functions that are needed
from the c library
• Executing the program
Constant
Whose value does not change
Constant
Numeric constant Character Constant
Integer constant Real constant
Single character constant string character constant
Rules for constructing integer constant
• An integer constant must have atleast one digit
• It must not have a decimal point
• It could be either +ve or –ve
• If no sign precedes an integer constant it is assumed to be +ve
• No commas or blanks are allowed within an integer constant
• Range for integer constant is -32768 to +32767
Rules for constructing Real constants
• A real constant must have atleast one digit
• It must have a decimal point
• Default sign is +ve
• No commas or blanks are allowed within a real constant
Single character constant
• These are contains single characters enclosed within a pair of
single quotation mark like ’ s’, ’z’, ’a’
eg printf(“%d”,’a’)
String character constant
• A string constant are enclosed in double quotation . Like
“kalyan”
Keywords of c
• Keyword is a reserve word of compiler or they
are already explain to the compiler
Like auto , double ,static , break ,else ,int , struct,
case, long ,switch, char, extern ,const, float etc
Variable
• A variable is a data name that may be used to
store a data value.During the execution of a
program a variable may take different values at
different times during execution
Thank you

More Related Content

Similar to Lecture 2 Bca 1 year.pptx

Unit ii
Unit   iiUnit   ii
Unit ii
sathisaran
 
Presentation
PresentationPresentation
Presentation
bhasula
 
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
SushmaG48
 
Anagha
AnaghaAnagha
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
KalighatOkira
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++
Vaibhav Khanna
 
C programming
C programmingC programming
C programming
KarthicaMarasamy
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
sumitbardhan
 
Introduction to C
Introduction to CIntroduction to C
Introduction to C
Janani Satheshkumar
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
8759000398
 
C programming language tutorial
C programming language tutorialC programming language tutorial
C programming language tutorial
SURBHI SAROHA
 
67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf
Rajb54
 
Data structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in CData structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in C
babuk110
 
Learning the C Language
Learning the C LanguageLearning the C Language
Learning the C Language
nTier Custom Solutions
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
GOKULKANNANMMECLECTC
 
M.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C LanguageM.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C Language
Dr.Florence Dayana
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
SIMONTHOMAS S
 
c-introduction.pptx
c-introduction.pptxc-introduction.pptx
c-introduction.pptx
Mangala R
 
DS functions-1.pptx
DS functions-1.pptxDS functions-1.pptx
DS functions-1.pptx
HarikishnaKNHk
 
CP c++ programing project Unit 1 intro.pdf
CP c++ programing project  Unit 1 intro.pdfCP c++ programing project  Unit 1 intro.pdf
CP c++ programing project Unit 1 intro.pdf
ShivamYadav886008
 

Similar to Lecture 2 Bca 1 year.pptx (20)

Unit ii
Unit   iiUnit   ii
Unit ii
 
Presentation
PresentationPresentation
Presentation
 
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
 
Anagha
AnaghaAnagha
Anagha
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++
 
C programming
C programmingC programming
C programming
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
 
Introduction to C
Introduction to CIntroduction to C
Introduction to C
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
C programming language tutorial
C programming language tutorialC programming language tutorial
C programming language tutorial
 
67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf
 
Data structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in CData structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in C
 
Learning the C Language
Learning the C LanguageLearning the C Language
Learning the C Language
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
 
M.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C LanguageM.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C Language
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
 
c-introduction.pptx
c-introduction.pptxc-introduction.pptx
c-introduction.pptx
 
DS functions-1.pptx
DS functions-1.pptxDS functions-1.pptx
DS functions-1.pptx
 
CP c++ programing project Unit 1 intro.pdf
CP c++ programing project  Unit 1 intro.pdfCP c++ programing project  Unit 1 intro.pdf
CP c++ programing project Unit 1 intro.pdf
 

More from classall

E -COMMERCE.ppt
E -COMMERCE.pptE -COMMERCE.ppt
E -COMMERCE.ppt
classall
 
CONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VBCONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VB
classall
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptx
classall
 
Tally_Tutor_1.ppt
Tally_Tutor_1.pptTally_Tutor_1.ppt
Tally_Tutor_1.ppt
classall
 
networking
networking networking
networking
classall
 
introduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxintroduction to visual basic PPT.pptx
introduction to visual basic PPT.pptx
classall
 
introduction to e-commerce.pptx
introduction to e-commerce.pptxintroduction to e-commerce.pptx
introduction to e-commerce.pptx
classall
 
E-Rdiagram.ppt
E-Rdiagram.pptE-Rdiagram.ppt
E-Rdiagram.ppt
classall
 
EDI presentation.pptx
EDI presentation.pptxEDI presentation.pptx
EDI presentation.pptx
classall
 
control structure in visual basic
control structure in visual basic control structure in visual basic
control structure in visual basic
classall
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.ppt
classall
 
SAVE WATER SAVE LIFE
SAVE WATER SAVE LIFESAVE WATER SAVE LIFE
SAVE WATER SAVE LIFE
classall
 
MS OFFICE
MS OFFICEMS OFFICE
MS OFFICE
classall
 
MULTIMEDIA
MULTIMEDIAMULTIMEDIA
MULTIMEDIA
classall
 
GEETA2.pptx
GEETA2.pptxGEETA2.pptx
GEETA2.pptx
classall
 
GEETA1.pptx
GEETA1.pptxGEETA1.pptx
GEETA1.pptx
classall
 
GEETA.pptx
GEETA.pptxGEETA.pptx
GEETA.pptx
classall
 
राष्ट्रीय एकता 13.3.18.ppt
राष्ट्रीय एकता 13.3.18.pptराष्ट्रीय एकता 13.3.18.ppt
राष्ट्रीय एकता 13.3.18.ppt
classall
 
mmu.pptx
mmu.pptxmmu.pptx
mmu.pptx
classall
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
classall
 

More from classall (20)

E -COMMERCE.ppt
E -COMMERCE.pptE -COMMERCE.ppt
E -COMMERCE.ppt
 
CONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VBCONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VB
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptx
 
Tally_Tutor_1.ppt
Tally_Tutor_1.pptTally_Tutor_1.ppt
Tally_Tutor_1.ppt
 
networking
networking networking
networking
 
introduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxintroduction to visual basic PPT.pptx
introduction to visual basic PPT.pptx
 
introduction to e-commerce.pptx
introduction to e-commerce.pptxintroduction to e-commerce.pptx
introduction to e-commerce.pptx
 
E-Rdiagram.ppt
E-Rdiagram.pptE-Rdiagram.ppt
E-Rdiagram.ppt
 
EDI presentation.pptx
EDI presentation.pptxEDI presentation.pptx
EDI presentation.pptx
 
control structure in visual basic
control structure in visual basic control structure in visual basic
control structure in visual basic
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.ppt
 
SAVE WATER SAVE LIFE
SAVE WATER SAVE LIFESAVE WATER SAVE LIFE
SAVE WATER SAVE LIFE
 
MS OFFICE
MS OFFICEMS OFFICE
MS OFFICE
 
MULTIMEDIA
MULTIMEDIAMULTIMEDIA
MULTIMEDIA
 
GEETA2.pptx
GEETA2.pptxGEETA2.pptx
GEETA2.pptx
 
GEETA1.pptx
GEETA1.pptxGEETA1.pptx
GEETA1.pptx
 
GEETA.pptx
GEETA.pptxGEETA.pptx
GEETA.pptx
 
राष्ट्रीय एकता 13.3.18.ppt
राष्ट्रीय एकता 13.3.18.pptराष्ट्रीय एकता 13.3.18.ppt
राष्ट्रीय एकता 13.3.18.ppt
 
mmu.pptx
mmu.pptxmmu.pptx
mmu.pptx
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 

Recently uploaded

Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
andagarcia212
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
BPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end examBPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end exam
sonukumargpnirsadhan
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
Celine George
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 

Recently uploaded (20)

Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
BPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end examBPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end exam
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 

Lecture 2 Bca 1 year.pptx

  • 1. Lecture 2 Programming in C language VIDYA CLASSES Asstt. Professor Department of computer science and IT
  • 2. Introduction of c • In 1960 B language (Basic combined programming language) was developed • Modified by DENNIS RITCHIE at bell laboratories in 1972
  • 3. Importance of c • It is strong language whose functions and operators can be used to write any complex program • Programs written in c are efficient and fast due to it’s variety of data types and powerful operators. It is many time faster than basic • In c many standard functions are available which can be used for developing programs • C is highly portable it means that c programs written for one computer can be run for another • Basically c is collection of function that are supported by c library .We can continuously add our own functions to the c library so it’s ability to extend itself
  • 4. Basic Structure of c Program Documentation Section Documentation Section Link section Defination Section Global Declaration Section Main() Function Section { Declaration part Executable part } Subprogram Section Fun 1 Fun 2 . . . Fun 4
  • 5. eg. /* To find circumfarance of circle*/ #include<stdio.h> #include<conio.h> # define pi 3.14 main() { float c,r=5; c=2*pi*r; printf(“circumfarance=%f”,c); getch(); }
  • 6. Character Set • Letter Uppercase A……Z Lowercase a….z • Digits 0…..9 • Special Character Comma,colon,question mark • White Space Blank space,horizontal tab,newline
  • 7. Tockens in C Smallest individual units are called tockens .Their are 6 types of tockens • Keywords eg. Auto , char • No to identifiers eg. A(n),B(n),name,variable,function • Constants eg.50,-23.7 • String eg. “kalyan”, “data” • Special Symbol eg.{},[],# • Operators eg. +,-,*
  • 8. Executing a c program • Creating the program • Compiling the program • Linking the program with functions that are needed from the c library • Executing the program
  • 9. Constant Whose value does not change Constant Numeric constant Character Constant Integer constant Real constant Single character constant string character constant
  • 10. Rules for constructing integer constant • An integer constant must have atleast one digit • It must not have a decimal point • It could be either +ve or –ve • If no sign precedes an integer constant it is assumed to be +ve • No commas or blanks are allowed within an integer constant • Range for integer constant is -32768 to +32767
  • 11. Rules for constructing Real constants • A real constant must have atleast one digit • It must have a decimal point • Default sign is +ve • No commas or blanks are allowed within a real constant
  • 12. Single character constant • These are contains single characters enclosed within a pair of single quotation mark like ’ s’, ’z’, ’a’ eg printf(“%d”,’a’) String character constant • A string constant are enclosed in double quotation . Like “kalyan”
  • 13. Keywords of c • Keyword is a reserve word of compiler or they are already explain to the compiler Like auto , double ,static , break ,else ,int , struct, case, long ,switch, char, extern ,const, float etc Variable • A variable is a data name that may be used to store a data value.During the execution of a program a variable may take different values at different times during execution