DI03011011 · Semester 3 · 5G scheme
Programming in C
Notes and solutions following the Gujarat Technological University (GTU) syllabus for DI03011011. Independent material — not issued by the university.
Materials
Complete Book
The whole syllabus, unit by unit, written for the exam.
Complete Book
87 pages
Premium Preview · 20 pages
Problem Solver
Step-by-step solutions to typical problems.
Problem Solver
35 pages
Premium Preview · 5 pages
Slides
Lecture slides for revision.
Lecture slides (full course)
442 pages
Premium Preview · 10 pagesSlides (compact edition)
277 pages
Premium Preview · 10 pages
Syllabus units
Unit 1: Basics of C Programming
- 1.1 Algorithms and Flow Charts:
- 1.1.1 Definition and Steps for writing Algorithm
- 1.1.2 Definition and Symbols of Flowchart.
- 1.1.3 Write Algorithm and Draw Flowchart for various Programs.
- 1.2 Structure of C program.
- 1.3 Character set, C tokens, Keywords, Identifiers, Constants, Variables, Rules for naming Variables.
- 1.4 Data Types:
- 1.4.1 Predefined Data types: integer-unsigned, signed, long, float, double, character, single, octal, hexadecimal
- 1.4.2 User defined Data Types: Arrays, Structures.
Unit 2: Operator & Expressions and input/output Functions
- 2.1 Types of Operators: Arithmetic, logical, relational, assignment, conditional, increment and decrement.
- 2.2 Operator Precedence, Associativity of Operators
- 2.3 Programming exercise based on operators
- 2.4 Evaluation of Arithmetic and Logical Expression
- 2.5 Input and Output Functions: getch(), gets(), scanf(), putch(), puts(), printf() function
Unit 3: Decision Control & Looping
- 3.1 Introduction to decision control
- 3.2 Decision Control statements:
- 3.2.1 if Statement
- 3.2.2 if-else Statement
- 3.2.3 if-else-if ladder statement
- 3.2.4 nested if-else statement
- 3.2.5 switch case statement
- 3.3 Introduction to branching and looping Statement
- 3.4.1 while Loop
- 3.4.2 Do-While Loop
- 3.4.3 For Loop
- 3.4.4 nested for loop
- 3.4.5 break, continue Statement
- 3.4.6 goto statement
Unit 4: Array and Pointer
- 4.1 Introduction to an Array
- 4.2 One dimensional array of int, float & characters: Declaration, initialization, Storing Array Elements in Memory, Displaying Array Elements
- 4.3 Two-dimensional array of int: Declaration, initialization, Storing Array Elements in Memory, Displaying Array Elements
- 4.4 Programming exercises based on One Dimensional array
- 4.5 Concept of Pointer; Pointer variables, Declaration of pointer, Initialization of Pointer
Unit 5: Introduction to String, Structures, Function and File Operations
- 5.1 Introduction to String
- 5.1.1 Declaration, Initialization and Display of string
- 5.1.2 Standard Library String Functions: strlen(), strcpy(), strcat(), strcmp()
- 5.2 Introduction to structures
- 5.2.1 Declaring a Structure
- 5.2.2 Initialization of Structure elements
- 5.2.3 Accessing Structure elements
- 5.3 Introduction to Function
- 5.3.1 Types of Function: Library Function and User Defined Function
- 5.3.2 Library Function
- 5.3.2.1 math functions like: mod(), sqrt(), pow(), exp(), sum(), round()
- 5.3.2.2 Character Functions like islower(), isupper(), isdigit(), tolower(), toupper()
- 5.4 Introduction to File Operations fopen() in r and w mode only, fclose() function
About this course
C language is a basic programming language for enhancing the student's logical and problem-solving ability of students. It is one of the most used middle level programming languages in industry. It is widely used to develop system programming, operating systems, embedded systems. Also, C is used for creating computer applications that are used in writing embedded software/firmware for various micro-controller-based products in electronics, industrial and communications. C language is also used in developing verification software, test code and simulators for various applications and hardware products. This course enhances and builds confidence in the programming skills of diploma students. This course will enable students to inculcate programming concepts and methodology to solve engineering problems.