Section outline


  • Aims/Rationale: To teach the students about C programming fundamentals so that they can apply this knowledge in their academic and professional fields.

    Learning Outcomes: At the end of the session participant will be able to :

    • Understand the character set, keywords in C
    • Learn basic data types in C
    • Write different types of expressions and statements in C
    • Understand different types of operators and their uses in c programming.

    Lecture Contents:

    • The character set of C
    • Identifiers
    • Keywords in C
    • Basic Data types in C
    • Variable and constants
    • Escape sequences
    • Complex, logical expressions
    • Operators and operands
    • Operator categories
    • Prefix & Postfix


    • Task 1
      Write a C program which will swap two integer values. Hint: if a=10, b=20, then the output will be a=20, b

      Task 2

      Write a C program which will reverse a 3 digit integer number.


       


    • Lab task for today: Mr X draws 1200 Dollar as Basic salary. He also gets House rent 50% of basic, medical allowance 25% and Travel allowance 20% of basic. Mr X pays 20% of basic as income tax. Write a C program which will calculate the gross salary of Mr X.