SlideShare a Scribd company logo
1 of 20
Created by: Arave
Flowchart
Example flowchart
                                   Begin
Problem: Add 2 numbers
Pseudo code
1. Begin                       Read number 1
2. Read number 1
3. Read number 2
                               Read number 2
4. Add number 1 & number 2
5. End
                             Answer = no1 + no2


                                    End
Example C Programming
 #include <stdio.h> //Preprocessor Directives

 int main ()
 {
 //Local Declaration
    int a, b, sum;

 //Statements
    printf("Enter two numbersn: ");
    scanf("%d %d", &a, &b);

 //Operation
    sum = a + b;

 //Output
    printf("The total is:%d", sum);

     getch ();
     return 0;
 }
C Structure
    Preprocessor Directives
                Global
              Declaration
void main()
{
        Local Declaration
              Statements
}
Preprocessor Directives

 First statement executed by compiler
 Begin with a pound sign or hash ( # )
 Example : #include and #define
Header Files/Libraries

 Header files have the extension .h
 two ways to include a header file:
  1.    #include "stdio.h"
  2.    #include <stdio.h>
Example

#include <stdio.h>          Header
#include <stlib.h>          files
void main()
{
printf("Hello world!!!");

}
Input (printf)

 How to transfer/store the data to
  computer
 Interactive – keyboard, touch
  screen, mouse – response from user
 User understand type of input data
Example

  void main()
  {
     int num1;
     printf(“Key-in number: "); //Input
     scanf(“%d”,&num1);
         .
         .
         .
         .
         .
         .
    return 0;
  }
Escape sequence   functions
        n        New line
       t         Horizontal tab
       v         Vertical tab
       b         backspace
       a         Bell or a beep
                backslash
       ’         Single quote
       ”         double quote
Input (scanf)

 Address in which user input store
  temporary
 Symbol ‘&’ referred to address to the
  variable
Example

  void main()
  {
     int num1; //variable

      printf(“Key-in number: "); //Input

       scanf(“%d”,&num1);
           .
           .
           .
           .
           .
           .
      return 0;
  }
Variable type   scanf Format Specifier
    int               %d, %i
   float                 %f
    char                 %c
 long int               %ld
  string                 %s
  double                %lf
Type of arithmetic operator
Type       Meaning

       *   Multiplication

       /   Division and integer division

           Modulus
       %
       +   Addition

       -   Substraction
Unary Operator


Operator   Example   Description   Equivalent   Statements

   ++        i++;    Postfix        i=i+1;        i+=1;
   ++        ++i;    Prefix         i=i+1;        i+=1;
   --         i--;   Postfix         i=i-1;        i-=1;
   --         --i;   Prefix          i=i-1;        i-=1;
Order of precedence

• Arithmetic Operation Priority

                    High Priority

()          left to right
++, --      left to right
* , /, %    left to right
+,-         left to right
Type of Relational Operator
Operator   Description     Example

  ==       equal to             x==y

  >        greater than          x>y

  <        less than             x<y

  >=       greater or           x>=y
           equal
  <=       less or equal        x<=y

  !=       Not equal to         x!=y
Type of Logical Operator
Operator   Meaning Example

  && AND            ((x<y)&&(x!=0))


  || OR             ((x<y)||(x!=0))


   ! NOT               !(x>=y)
Thank You!

More Related Content

What's hot

C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)SURBHI SAROHA
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)SURBHI SAROHA
 
7. input and output functions
7. input and output functions7. input and output functions
7. input and output functionsWay2itech
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in CMuthuganesh S
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingSabik T S
 
C programming(part 3)
C programming(part 3)C programming(part 3)
C programming(part 3)SURBHI SAROHA
 
Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C ProgrammingKamal Acharya
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]Abhishek Sinha
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in cSaranya saran
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branchingSaranya saran
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7Rumman Ansari
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4Saranya saran
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6Rumman Ansari
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5Rumman Ansari
 

What's hot (20)

C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
7. input and output functions
7. input and output functions7. input and output functions
7. input and output functions
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C programming(part 3)
C programming(part 3)C programming(part 3)
C programming(part 3)
 
Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C Programming
 
Working with IDE
Working with IDEWorking with IDE
Working with IDE
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
 
What is c
What is cWhat is c
What is c
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 
Unit ii ppt
Unit ii pptUnit ii ppt
Unit ii ppt
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
 
Lecture 6- Intorduction to C Programming
Lecture 6- Intorduction to C ProgrammingLecture 6- Intorduction to C Programming
Lecture 6- Intorduction to C Programming
 
C programming
C programmingC programming
C programming
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
 

Viewers also liked

Flowchart Example
Flowchart ExampleFlowchart Example
Flowchart Examplebigdeecross
 
Symbol for drawing flowchart
Symbol for drawing flowchartSymbol for drawing flowchart
Symbol for drawing flowchartKamal Tamang
 
Table Of Flowchart Symbols
Table Of Flowchart SymbolsTable Of Flowchart Symbols
Table Of Flowchart SymbolsNeo Nguyens
 
Programming process and flowchart
Programming process and flowchartProgramming process and flowchart
Programming process and flowcharthermiraguilar
 
Flowchart symbols meaning explained
Flowchart symbols meaning explainedFlowchart symbols meaning explained
Flowchart symbols meaning explainedEliza Wright
 
Presentation on diagram and flowchart
Presentation on diagram and flowchartPresentation on diagram and flowchart
Presentation on diagram and flowchartSwarnima Tiwari
 
Flow chart powerpoint presentation slides ppt templates
Flow chart powerpoint presentation slides ppt templatesFlow chart powerpoint presentation slides ppt templates
Flow chart powerpoint presentation slides ppt templatesSlideTeam.net
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C LanguageAryan Ajmer
 

Viewers also liked (13)

Flowchart Example
Flowchart ExampleFlowchart Example
Flowchart Example
 
Symbol for drawing flowchart
Symbol for drawing flowchartSymbol for drawing flowchart
Symbol for drawing flowchart
 
Chapter 6 Flowchart
Chapter 6   FlowchartChapter 6   Flowchart
Chapter 6 Flowchart
 
Table Of Flowchart Symbols
Table Of Flowchart SymbolsTable Of Flowchart Symbols
Table Of Flowchart Symbols
 
Flow charts
Flow chartsFlow charts
Flow charts
 
Programming process and flowchart
Programming process and flowchartProgramming process and flowchart
Programming process and flowchart
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 
Flowchart symbols meaning explained
Flowchart symbols meaning explainedFlowchart symbols meaning explained
Flowchart symbols meaning explained
 
Presentation on diagram and flowchart
Presentation on diagram and flowchartPresentation on diagram and flowchart
Presentation on diagram and flowchart
 
Flowchart
FlowchartFlowchart
Flowchart
 
Flow chart powerpoint presentation slides ppt templates
Flow chart powerpoint presentation slides ppt templatesFlow chart powerpoint presentation slides ppt templates
Flow chart powerpoint presentation slides ppt templates
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C Language
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 

Similar to Intro to c chapter cover 1 4

presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxKrishanPalSingh39
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c programNishmaNJ
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4MKalpanaDevi
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariTHE NORTHCAP UNIVERSITY
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1AmIt Prasad
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxKrishanPalSingh39
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxLikhil181
 
Lecture 3 and 4.pptx
Lecture 3 and 4.pptxLecture 3 and 4.pptx
Lecture 3 and 4.pptxMAHAMASADIK
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1Little Tukta Lita
 
Control structure of c
Control structure of cControl structure of c
Control structure of cKomal Kotak
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 FocJAYA
 
The best every notes on c language is here check it out
The best every notes on c language is here check it outThe best every notes on c language is here check it out
The best every notes on c language is here check it outrajatryadav22
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02Wingston
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about CYi-Hsiu Hsu
 

Similar to Intro to c chapter cover 1 4 (20)

2. operator
2. operator2. operator
2. operator
 
C tutorial
C tutorialC tutorial
C tutorial
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
 
Functions
FunctionsFunctions
Functions
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
 
7 functions
7  functions7  functions
7 functions
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
Lecture 3 and 4.pptx
Lecture 3 and 4.pptxLecture 3 and 4.pptx
Lecture 3 and 4.pptx
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
 
Control structure of c
Control structure of cControl structure of c
Control structure of c
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 Foc
 
The best every notes on c language is here check it out
The best every notes on c language is here check it outThe best every notes on c language is here check it out
The best every notes on c language is here check it out
 
Operators1.pptx
Operators1.pptxOperators1.pptx
Operators1.pptx
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about C
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 

Intro to c chapter cover 1 4

  • 3. Example flowchart Begin Problem: Add 2 numbers Pseudo code 1. Begin Read number 1 2. Read number 1 3. Read number 2 Read number 2 4. Add number 1 & number 2 5. End Answer = no1 + no2 End
  • 4. Example C Programming #include <stdio.h> //Preprocessor Directives int main () { //Local Declaration int a, b, sum; //Statements printf("Enter two numbersn: "); scanf("%d %d", &a, &b); //Operation sum = a + b; //Output printf("The total is:%d", sum); getch (); return 0; }
  • 5. C Structure Preprocessor Directives Global Declaration void main() { Local Declaration Statements }
  • 6. Preprocessor Directives  First statement executed by compiler  Begin with a pound sign or hash ( # )  Example : #include and #define
  • 7. Header Files/Libraries  Header files have the extension .h  two ways to include a header file: 1. #include "stdio.h" 2. #include <stdio.h>
  • 8. Example #include <stdio.h> Header #include <stlib.h> files void main() { printf("Hello world!!!"); }
  • 9. Input (printf)  How to transfer/store the data to computer  Interactive – keyboard, touch screen, mouse – response from user  User understand type of input data
  • 10. Example void main() { int num1; printf(“Key-in number: "); //Input scanf(“%d”,&num1); . . . . . . return 0; }
  • 11. Escape sequence functions n New line t Horizontal tab v Vertical tab b backspace a Bell or a beep backslash ’ Single quote ” double quote
  • 12. Input (scanf)  Address in which user input store temporary  Symbol ‘&’ referred to address to the variable
  • 13. Example void main() { int num1; //variable printf(“Key-in number: "); //Input scanf(“%d”,&num1); . . . . . . return 0; }
  • 14. Variable type scanf Format Specifier int %d, %i float %f char %c long int %ld string %s double %lf
  • 15. Type of arithmetic operator Type Meaning * Multiplication / Division and integer division Modulus % + Addition - Substraction
  • 16. Unary Operator Operator Example Description Equivalent Statements ++ i++; Postfix i=i+1; i+=1; ++ ++i; Prefix i=i+1; i+=1; -- i--; Postfix i=i-1; i-=1; -- --i; Prefix i=i-1; i-=1;
  • 17. Order of precedence • Arithmetic Operation Priority High Priority () left to right ++, -- left to right * , /, % left to right +,- left to right
  • 18. Type of Relational Operator Operator Description Example == equal to x==y > greater than x>y < less than x<y >= greater or x>=y equal <= less or equal x<=y != Not equal to x!=y
  • 19. Type of Logical Operator Operator Meaning Example && AND ((x<y)&&(x!=0)) || OR ((x<y)||(x!=0)) ! NOT !(x>=y)