SlideShare a Scribd company logo
C
Programmin
g
LET’S GET INTO IT!!
How to get started?
The best way to learn any new language or programming language is by applying i.e. in case of
programming language by writing simple and basic codes in it. And there’s that famous sentence
or sentence-ling to do all your experimentations on:
“Hello World!”
So, your first step towards learning the language will be to print this.
To do so, you have to first right the text somewhere, then compile it (make it read by the
computer), load it and then by running it you can print it.
The Syntax
#include <stdio.h>
int main () //you can use void main() or main()
{
Printf (“Hello World!”);
return 0; /* in case of main() you can use getch(), but
for void main() there’s no need of anything*/
}
For your first C program
How to make your
computer
understand what
to do?
Human being speak languages that is interpretable by
human beings but not machines. The general language for
machines has been denoted by ‘I’ and ‘O’ or 1 and 0, where
I/1 denotes the upstate of any signal and O/0 denotes the
downstate.
Though we can understand and interpret everything in this
binary language (presence of only two enitities) but if we
have to convert the human language (known as High-level
languages) into binary then it will be a work for eternity.
This is where Compilers come into play.
Basically compiler is a program that converts and reads out
the instructions written in human language to binary
language to the computer, so that it can interpret the
instructions and check for errors and execute them.
Role of a Compiler
Different Compilers
1) Turbo C++ - for both C and C++, old-fashioned command prompt like
(https://developerinsider.co/downloading/?download=https://github.com/vineetchoudhary/turbocp
p/releases/download/v3.2/Turbo.C.3.2.zip?raw=true&after=https://developerinsider.co/c-and-cpp-
insider/)
2) Dev C++ - for both C and C++, advanced and new generation
(https://sourceforge.net/projects/orwelldevcpp/)
3) Codeblocks – for many languages like C, C++, Java and more
(http://www.codeblocks.org/downloads)
4) Notepad – If you write the program syntax and save it with program extension ‘.c’ it will be saved
automatically as a C program file and then you have to execute it through command prompt.
Compiler vs Interpreter
COMPILER
1. Scans the entire program and translates it as
a whole into machine code.
2. Compilers usually take a large amount of
time to analyze the source code. However, the
overall execution time is comparatively faster
than interpreters.
3. Generates intermediate object code which
further requires linking, hence requires more
memory.
4. Programming languages like C, C++, Java use
compilers.
INTERPRETER
1. Translates program one statement at a time.
2. Interpreters usually take less amount of time
to analyze the source code. However, the
overall execution time is comparatively slower
than compilers.
3. No intermediate object code is generated,
hence are memory efficient.
4. Programming languages like JavaScript,
Python, Ruby use interpreters.
Program execution in Turbo C++
Program execution in Dev C++
Program execution in Codeblocks
Program Execution in Ubuntu/Linux

More Related Content

What's hot (11)

Basic information of C++
Basic information of C++Basic information of C++
Basic information of C++
Fahad Farooq
 
The Ring programming language version 1.7 book - Part 19 of 196
The Ring programming language version 1.7 book - Part 19 of 196The Ring programming language version 1.7 book - Part 19 of 196
The Ring programming language version 1.7 book - Part 19 of 196
Mahmoud Samir Fayed
 
Polyglot Programmer
Polyglot ProgrammerPolyglot Programmer
Polyglot Programmer
João Cerdeira
 
Basic concepts of c language
Basic concepts of c languageBasic concepts of c language
Basic concepts of c language
Pramod Choudhary
 
Processing @ Javascriptcamp
Processing @ JavascriptcampProcessing @ Javascriptcamp
Processing @ Javascriptcamp
Francesco Fullone
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
MohdVais1
 
C Lecture
C LectureC Lecture
C Lecture
Sudharsan S
 
best it courcess
best it courcessbest it courcess
best it courcess
PrinceMail
 
Shell.me
Shell.meShell.me
Shell.me
Christoph Burgdorf
 
The beginning for programmers
The beginning for programmersThe beginning for programmers
The beginning for programmers
AthTek Software
 
Php
PhpPhp
Php
MallikharjunaReddySa
 

Similar to C programming ii (20)

Unit 1
Unit 1Unit 1
Unit 1
TPLatchoumi
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
Kuntal Bhowmick
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
Subramanyambharathis
 
Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7
Shipra Swati
 
C language industrial training report
C language industrial training reportC language industrial training report
C language industrial training report
Raushan Pandey
 
Agro informatics centre up State of Lec 6.pptx
Agro informatics centre up State of Lec 6.pptxAgro informatics centre up State of Lec 6.pptx
Agro informatics centre up State of Lec 6.pptx
muddydevil2003
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
zaheeriqbal41
 
Programming in C & Decision Making Branching
Programming in C & Decision Making BranchingProgramming in C & Decision Making Branching
Programming in C & Decision Making Branching
VishnuPriya810389
 
Programming in C and Decision Making Branching
Programming in C and Decision Making BranchingProgramming in C and Decision Making Branching
Programming in C and Decision Making Branching
Rvishnupriya2
 
introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)
Abhishek Walia
 
Programming in c
Programming in cProgramming in c
Programming in c
vishnu973656
 
Programming in C
Programming in CProgramming in C
Programming in C
Rvishnupriya2
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming
Hemantha Kulathilake
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
Muhammed Thanveer M
 
Introduction to C Programming Language.pptx
Introduction to C Programming Language.pptxIntroduction to C Programming Language.pptx
Introduction to C Programming Language.pptx
AnithaTAssistantProf
 
C.pdf
C.pdfC.pdf
C.pdf
5reality786
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
BAKRANIYA KALPESH
 
L1.1 Introduction to Programming Languages.pptx
L1.1 Introduction to Programming Languages.pptxL1.1 Introduction to Programming Languages.pptx
L1.1 Introduction to Programming Languages.pptx
shiblyrahman7
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
Andrea Tino
 
C class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdfC class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdf
mayankamandal
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
Subramanyambharathis
 
Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7
Shipra Swati
 
C language industrial training report
C language industrial training reportC language industrial training report
C language industrial training report
Raushan Pandey
 
Agro informatics centre up State of Lec 6.pptx
Agro informatics centre up State of Lec 6.pptxAgro informatics centre up State of Lec 6.pptx
Agro informatics centre up State of Lec 6.pptx
muddydevil2003
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
zaheeriqbal41
 
Programming in C & Decision Making Branching
Programming in C & Decision Making BranchingProgramming in C & Decision Making Branching
Programming in C & Decision Making Branching
VishnuPriya810389
 
Programming in C and Decision Making Branching
Programming in C and Decision Making BranchingProgramming in C and Decision Making Branching
Programming in C and Decision Making Branching
Rvishnupriya2
 
introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)
Abhishek Walia
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming
Hemantha Kulathilake
 
Introduction to C Programming Language.pptx
Introduction to C Programming Language.pptxIntroduction to C Programming Language.pptx
Introduction to C Programming Language.pptx
AnithaTAssistantProf
 
L1.1 Introduction to Programming Languages.pptx
L1.1 Introduction to Programming Languages.pptxL1.1 Introduction to Programming Languages.pptx
L1.1 Introduction to Programming Languages.pptx
shiblyrahman7
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
Andrea Tino
 
C class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdfC class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdf
mayankamandal
 

Recently uploaded (20)

LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
Critical Thinking and Bias with Jibi Moses
Critical Thinking and Bias with Jibi MosesCritical Thinking and Bias with Jibi Moses
Critical Thinking and Bias with Jibi Moses
Excellence Foundation for South Sudan
 
How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18
Celine George
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Introduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdfIntroduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdf
CME4Life
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT PatnaSwachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Quiz Club, Indian Institute of Technology, Patna
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
Julián Jesús Pérez Fernández
 
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar SirPHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
Diwakar Kashyap
 
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATIONTHE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
PROF. PAUL ALLIEU KAMARA
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18
Celine George
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Introduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdfIntroduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdf
CME4Life
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar SirPHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
Diwakar Kashyap
 
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATIONTHE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
PROF. PAUL ALLIEU KAMARA
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 

C programming ii

  • 2. How to get started? The best way to learn any new language or programming language is by applying i.e. in case of programming language by writing simple and basic codes in it. And there’s that famous sentence or sentence-ling to do all your experimentations on: “Hello World!” So, your first step towards learning the language will be to print this. To do so, you have to first right the text somewhere, then compile it (make it read by the computer), load it and then by running it you can print it.
  • 3. The Syntax #include <stdio.h> int main () //you can use void main() or main() { Printf (“Hello World!”); return 0; /* in case of main() you can use getch(), but for void main() there’s no need of anything*/ } For your first C program
  • 4. How to make your computer understand what to do? Human being speak languages that is interpretable by human beings but not machines. The general language for machines has been denoted by ‘I’ and ‘O’ or 1 and 0, where I/1 denotes the upstate of any signal and O/0 denotes the downstate. Though we can understand and interpret everything in this binary language (presence of only two enitities) but if we have to convert the human language (known as High-level languages) into binary then it will be a work for eternity. This is where Compilers come into play. Basically compiler is a program that converts and reads out the instructions written in human language to binary language to the computer, so that it can interpret the instructions and check for errors and execute them. Role of a Compiler
  • 5. Different Compilers 1) Turbo C++ - for both C and C++, old-fashioned command prompt like (https://developerinsider.co/downloading/?download=https://github.com/vineetchoudhary/turbocp p/releases/download/v3.2/Turbo.C.3.2.zip?raw=true&after=https://developerinsider.co/c-and-cpp- insider/) 2) Dev C++ - for both C and C++, advanced and new generation (https://sourceforge.net/projects/orwelldevcpp/) 3) Codeblocks – for many languages like C, C++, Java and more (http://www.codeblocks.org/downloads) 4) Notepad – If you write the program syntax and save it with program extension ‘.c’ it will be saved automatically as a C program file and then you have to execute it through command prompt.
  • 6. Compiler vs Interpreter COMPILER 1. Scans the entire program and translates it as a whole into machine code. 2. Compilers usually take a large amount of time to analyze the source code. However, the overall execution time is comparatively faster than interpreters. 3. Generates intermediate object code which further requires linking, hence requires more memory. 4. Programming languages like C, C++, Java use compilers. INTERPRETER 1. Translates program one statement at a time. 2. Interpreters usually take less amount of time to analyze the source code. However, the overall execution time is comparatively slower than compilers. 3. No intermediate object code is generated, hence are memory efficient. 4. Programming languages like JavaScript, Python, Ruby use interpreters.
  • 9. Program execution in Codeblocks
  • 10. Program Execution in Ubuntu/Linux