SlideShare a Scribd company logo
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

PPTX
C Programming Language Part 9
PPT
Mesics lecture 5 input – output in ‘c’
PPTX
C Programming Language Part 11
PPTX
C Programming Language Part 8
PPTX
Data Input and Output
PPTX
Basic Input and Output
PPT
Input And Output
PPSX
Concepts of C [Module 2]
C Programming Language Part 9
Mesics lecture 5 input – output in ‘c’
C Programming Language Part 11
C Programming Language Part 8
Data Input and Output
Basic Input and Output
Input And Output
Concepts of C [Module 2]

What's hot (20)

PPTX
C programming(Part 1)
PPTX
Programming in C (part 2)
PDF
7. input and output functions
PPTX
Input output statement in C
PPTX
Introduction to C programming
PPTX
C programming(part 3)
PPTX
Input Output Management In C Programming
PPTX
Working with IDE
PPSX
Programming in C [Module One]
PPTX
Expressions using operator in c
PPTX
Decision making and branching
PPTX
What is c
PPT
CPU INPUT OUTPUT
PPTX
C Programming Language Part 7
PPT
Functions and pointers_unit_4
PPTX
C Programming Language Part 6
PPT
Lecture 6- Intorduction to C Programming
PDF
C programming
PPTX
C Programming Language Step by Step Part 5
C programming(Part 1)
Programming in C (part 2)
7. input and output functions
Input output statement in C
Introduction to C programming
C programming(part 3)
Input Output Management In C Programming
Working with IDE
Programming in C [Module One]
Expressions using operator in c
Decision making and branching
What is c
CPU INPUT OUTPUT
C Programming Language Part 7
Functions and pointers_unit_4
C Programming Language Part 6
Lecture 6- Intorduction to C Programming
C programming
C Programming Language Step by Step Part 5
Ad

Viewers also liked (13)

DOC
Flowchart Example
PPTX
Symbol for drawing flowchart
PPT
Chapter 6 Flowchart
PDF
Table Of Flowchart Symbols
PPT
Flow charts
PPTX
Programming process and flowchart
PDF
Writing algorithms
PPTX
Flowchart symbols meaning explained
PPT
Presentation on diagram and flowchart
PPT
Flowchart
PDF
Flow chart powerpoint presentation slides ppt templates
PPTX
Programming flowcharts for C Language
PPTX
Algorithm and flowchart
Flowchart Example
Symbol for drawing flowchart
Chapter 6 Flowchart
Table Of Flowchart Symbols
Flow charts
Programming process and flowchart
Writing algorithms
Flowchart symbols meaning explained
Presentation on diagram and flowchart
Flowchart
Flow chart powerpoint presentation slides ppt templates
Programming flowcharts for C Language
Algorithm and flowchart
Ad

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

PPT
c-programming
DOC
2. operator
PPT
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
PPTX
introduction to c programming and C History.pptx
PPTX
Fundamentals of computers - C Programming
PPTX
component of c language.pptx
PDF
2 EPT 162 Lecture 2
PDF
Arithmetic instructions
PPTX
presentation_data_types_and_operators_1513499834_241350.pptx
PPT
Unit i intro-operators
PPTX
dinoC_ppt.pptx
PPT
Introduction to c
DOC
C fundamental
PDF
java or oops class not in kerala polytechnic 4rth semester nots j
PPTX
presentation_c_basics_1589366177_381682.pptx
PPTX
C programming language
PPTX
comp 122 Chapter 2.pptx,language semantics
PDF
learn basic to advance C Programming Notes
PPTX
C++ lecture 01
c-programming
2. operator
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
introduction to c programming and C History.pptx
Fundamentals of computers - C Programming
component of c language.pptx
2 EPT 162 Lecture 2
Arithmetic instructions
presentation_data_types_and_operators_1513499834_241350.pptx
Unit i intro-operators
dinoC_ppt.pptx
Introduction to c
C fundamental
java or oops class not in kerala polytechnic 4rth semester nots j
presentation_c_basics_1589366177_381682.pptx
C programming language
comp 122 Chapter 2.pptx,language semantics
learn basic to advance C Programming Notes
C++ lecture 01

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Yogi Goddess Pres Conference Studio Updates
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Microbial disease of the cardiovascular and lymphatic systems
LDMMIA Reiki Yoga Finals Review Spring Summer
Microbial diseases, their pathogenesis and prophylaxis
Chinmaya Tiranga quiz Grand Finale.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
RMMM.pdf make it easy to upload and study
A systematic review of self-coping strategies used by university students to ...
Orientation - ARALprogram of Deped to the Parents.pptx
Yogi Goddess Pres Conference Studio Updates
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Anesthesia in Laparoscopic Surgery in India
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
2.FourierTransform-ShortQuestionswithAnswers.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Cell Types and Its function , kingdom of life
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming

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)