SlideShare uma empresa Scribd logo
1 de 20
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Basic of C


   Atheendrh Kakkoth
   atheendrh@gmail.com
   Atheendrh kakkoth
Execution of C Program


•Creating a program :
An editor like notepad or word pad is used to create a C program. This file contains a
source code which consists of executable code. save as .c
• Compiling the program :
The next step is to compile the program. The code is compiled by using compiler. Compiler
converts executable code to binary code
•Linking a program to library :
The object code of a program is linked with libraries that are needed for execution of a
program. The linker is used to link the program with libraries.

•Execution of program :
The final executable file is then run by dos command prompt or by any other software.
Tokens
Tokens are individual words marks in passage of text. In C, program
the smallest individual units are known as C Tokens. C has Six
types of Tokens. The Tokens are shown in figure
Tokens
• Keywords
   – These are reserved words of the C language. For
     example int, float, if, else, for,
     while etc.
• Identifiers
   – An Identifier is a sequence of letters and digits, but
     must start with a letter. Underscore ( _ ) is treated as a
     letter. Identifiers are used to name variables, functions
     etc.
   – Valid: Root, _getchar, __sin, x1, x2,
     x3, x_1, If
   – Invalid: 324, short, price$, My Name
Tokens
• Constants
  – Constants like 13, ‘a’, 1.3e-5 etc.
• Strings
  – A sequence of characters enclosed in double
    quotes as “…”. For example “13” is a string literal
    and not number 13. ‘a’ and “a” are different.
• Operators
  – Arithmetic operators like +, -, *, / ,% etc.
  – Logical operators like ||, &&, ! etc. and so on
Tokens
• special symbol: ~ ! @ # $ % ^ & * ( ) _ + { } [ ]
  -<>,./?|:;"'


• White Spaces
  – Spaces, new lines, tabs, comments ( A sequence
    of characters enclosed in /* and */ ) etc. These are
    used to separate the adjacent identifiers, kewords
    and constants.
Header file                                    I
                                                               Identifiers
                           Key word



                                                    Strings

                                                        Special symbol


          Operators



Header file contains different predefined functions, which are required to run the
                                     program
Header File in C :
Header file contains different predefined
functions, which are required to run the
program. All header files should be included
explicitly before main ( ) function
Followings are the some commonly used header files which plays
a vital role in C programming :


        Assert.h          Ctype.h            Math.h

       Process.h          Stdio.h           Stdlib.h

        String.h           Time.h          Graphics.h
Stdio.h
stdio.h refers to standard input/output header file.
 The functions which are declared in stdio.h are very
 popular.
scanf() -used to take input from the standard input
 stream
Printf() -prints to the standard output stream
Data Types in C :
Decision Making Statements
  C program executes program sequentially.
  Sometimes, a program requires checking of
  certain conditions in program execution. These
  statements are called as 'Decision Making
  Statements' or 'Conditional Statements‘
• Followings are the different conditional
  statements used in C.
• If Statement
• If-Else Statement
If Statement :
This is a conditional statement used in C to
check condition or to control the flow of
execution of statements.

  Syntax:

if(condition)
      {
statements;
      }
If-Else Statement :
This is also one of the most useful conditional
  statement used in C to check conditions

       Syntax:
    if(condition)
           {
  true statements;
           }
         else
           {
  false statements;
           }
Looping Statements
  A loop is used using condition. The repetition is
  done until condition is true
• Some common examples of this looping
  statements are :
• while loop
• for loop
While loop
It is used to repeat a block of statements until
   condition is true.


 Syntax:
 while(condition)
  {
 statements;
  increment/decrement;
  }
For loop
One of the most important feature of this loop is
 that the three actions can be taken at a time like
 variable initilisation, condition checking
 and increment/decrement.                           #include <stdio.h>
                                                     #include <conio.h>
                                                    void main()
                      Syntax:                       {
                                                     int a;
 for(initialisation; test-condition; incre/decre)     for(i=0; i<=5; i++)
                                                     {
                          {                          printf("n");
                   statements;                      }

                          }
If this presentation helped you, please visit our
           page facebook.com/baabtra and like it.
               Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us

Mais conteúdo relacionado

Mais procurados

Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
C language for Semester Exams for Engineers
C language for Semester Exams for Engineers C language for Semester Exams for Engineers
C language for Semester Exams for Engineers Appili Vamsi Krishna
 
Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)Chitrakshi Jaiswal
 
PHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requirePHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requireTheCreativedev Blog
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programmingSudheer Kiran
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in CHarendra Singh
 
Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - OperatorsEng Teong Cheah
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programmingRumman Ansari
 
Schema, validation and generative testing
Schema, validation and generative testingSchema, validation and generative testing
Schema, validation and generative testingLaurence Chen
 

Mais procurados (20)

Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
C language ppt
C language pptC language ppt
C language ppt
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Unit 7. Functions
Unit 7. FunctionsUnit 7. Functions
Unit 7. Functions
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Learning the C Language
Learning the C LanguageLearning the C Language
Learning the C Language
 
C language for Semester Exams for Engineers
C language for Semester Exams for Engineers C language for Semester Exams for Engineers
C language for Semester Exams for Engineers
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)
 
PHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requirePHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and require
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programming
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
 
Cpu
CpuCpu
Cpu
 
Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - Operators
 
C Token’s
C Token’sC Token’s
C Token’s
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
 
Schema, validation and generative testing
Schema, validation and generative testingSchema, validation and generative testing
Schema, validation and generative testing
 

Destaque

Destaque (19)

Java exeception handling
Java exeception handlingJava exeception handling
Java exeception handling
 
XML
XMLXML
XML
 
XML
XMLXML
XML
 
Flowchart& algorithom
Flowchart& algorithomFlowchart& algorithom
Flowchart& algorithom
 
XML
XMLXML
XML
 
Binary tree
Binary treeBinary tree
Binary tree
 
Stack and heap
Stack and heapStack and heap
Stack and heap
 
Mail in php codeigniter
Mail in php codeigniterMail in php codeigniter
Mail in php codeigniter
 
Html tags
Html tagsHtml tags
Html tags
 
MIS
MISMIS
MIS
 
What is Python?
What is Python?What is Python?
What is Python?
 
Travel agency
Travel agency Travel agency
Travel agency
 
Dependent selection box using codeigniter ajax
Dependent selection box using codeigniter ajaxDependent selection box using codeigniter ajax
Dependent selection box using codeigniter ajax
 
Claas diagram
Claas diagramClaas diagram
Claas diagram
 
Modules in Python
Modules in PythonModules in Python
Modules in Python
 
how to prepare for an interview
how to prepare for an interviewhow to prepare for an interview
how to prepare for an interview
 
Bill gates and his contributions to world
Bill gates and his contributions to worldBill gates and his contributions to world
Bill gates and his contributions to world
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
System software and Application software
System software and Application softwareSystem software and Application software
System software and Application software
 

Semelhante a Basics of C porgramming

C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
 
C programming language tutorial
C programming language tutorialC programming language tutorial
C programming language tutorialSURBHI SAROHA
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdfKalighatOkira
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Rasan Samarasinghe
 
Unit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxUnit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxsaivasu4
 
MCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit Dubey
MCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit DubeyMCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit Dubey
MCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit Dubeykiranrajat
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 

Semelhante a Basics of C porgramming (20)

c programming session 1.pptx
c programming session 1.pptxc programming session 1.pptx
c programming session 1.pptx
 
C programming
C programmingC programming
C programming
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
Introduction to C
Introduction to CIntroduction to C
Introduction to C
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
Basics of C porgramming
Basics of C porgrammingBasics of C porgramming
Basics of C porgramming
 
C programming language tutorial
C programming language tutorialC programming language tutorial
C programming language tutorial
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
C language updated
C language updatedC language updated
C language updated
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C language
C languageC language
C language
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Unit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxUnit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptx
 
MCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit Dubey
MCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit DubeyMCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit Dubey
MCA 101-Programming in C with Data Structure UNIT I by Prof. Rohit Dubey
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
C intro
C introC intro
C intro
 
Presentation c++
Presentation c++Presentation c++
Presentation c++
 

Mais de baabtra.com - No. 1 supplier of quality freshers

Mais de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Basics of C porgramming

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. Basic of C Atheendrh Kakkoth atheendrh@gmail.com Atheendrh kakkoth
  • 4. Execution of C Program •Creating a program : An editor like notepad or word pad is used to create a C program. This file contains a source code which consists of executable code. save as .c • Compiling the program : The next step is to compile the program. The code is compiled by using compiler. Compiler converts executable code to binary code •Linking a program to library : The object code of a program is linked with libraries that are needed for execution of a program. The linker is used to link the program with libraries. •Execution of program : The final executable file is then run by dos command prompt or by any other software.
  • 5. Tokens Tokens are individual words marks in passage of text. In C, program the smallest individual units are known as C Tokens. C has Six types of Tokens. The Tokens are shown in figure
  • 6. Tokens • Keywords – These are reserved words of the C language. For example int, float, if, else, for, while etc. • Identifiers – An Identifier is a sequence of letters and digits, but must start with a letter. Underscore ( _ ) is treated as a letter. Identifiers are used to name variables, functions etc. – Valid: Root, _getchar, __sin, x1, x2, x3, x_1, If – Invalid: 324, short, price$, My Name
  • 7. Tokens • Constants – Constants like 13, ‘a’, 1.3e-5 etc. • Strings – A sequence of characters enclosed in double quotes as “…”. For example “13” is a string literal and not number 13. ‘a’ and “a” are different. • Operators – Arithmetic operators like +, -, *, / ,% etc. – Logical operators like ||, &&, ! etc. and so on
  • 8. Tokens • special symbol: ~ ! @ # $ % ^ & * ( ) _ + { } [ ] -<>,./?|:;"' • White Spaces – Spaces, new lines, tabs, comments ( A sequence of characters enclosed in /* and */ ) etc. These are used to separate the adjacent identifiers, kewords and constants.
  • 9. Header file I Identifiers Key word Strings Special symbol Operators Header file contains different predefined functions, which are required to run the program
  • 10. Header File in C : Header file contains different predefined functions, which are required to run the program. All header files should be included explicitly before main ( ) function Followings are the some commonly used header files which plays a vital role in C programming : Assert.h Ctype.h Math.h Process.h Stdio.h Stdlib.h String.h Time.h Graphics.h
  • 11. Stdio.h stdio.h refers to standard input/output header file. The functions which are declared in stdio.h are very popular. scanf() -used to take input from the standard input stream Printf() -prints to the standard output stream
  • 13. Decision Making Statements C program executes program sequentially. Sometimes, a program requires checking of certain conditions in program execution. These statements are called as 'Decision Making Statements' or 'Conditional Statements‘ • Followings are the different conditional statements used in C. • If Statement • If-Else Statement
  • 14. If Statement : This is a conditional statement used in C to check condition or to control the flow of execution of statements. Syntax: if(condition) { statements; }
  • 15. If-Else Statement : This is also one of the most useful conditional statement used in C to check conditions Syntax: if(condition) { true statements; } else { false statements; }
  • 16. Looping Statements A loop is used using condition. The repetition is done until condition is true • Some common examples of this looping statements are : • while loop • for loop
  • 17. While loop It is used to repeat a block of statements until condition is true. Syntax: while(condition) { statements; increment/decrement; }
  • 18. For loop One of the most important feature of this loop is that the three actions can be taken at a time like variable initilisation, condition checking and increment/decrement. #include <stdio.h> #include <conio.h> void main() Syntax: { int a; for(initialisation; test-condition; incre/decre) for(i=0; i<=5; i++) { { printf("n"); statements; } }
  • 19. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com