SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

En vedette (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
 

Similaire à 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
 

Similaire à 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++
 

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

Plus 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
 

Dernier

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
 
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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 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
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Dernier (20)

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...
 
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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
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...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

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