









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This is the beginning of your structured programming C.
Typology: Slides
1 / 17
This page cannot be seen from the preview
Don't miss anything!










Course Objectives To provide advanced knowledge and experience on structured programming To help students to develop programming skills to solve different problems To make students able to understand and implement various concepts and structures of C programming language To make students able to write reusable modules using C functions To exercise good programming practices in the design of programs
Recommended Books
6 Stephen G. Kochan. “Programming in C”, 4 th ed., Addison-Wesley Professional, 2014.
C Programming Language General-purpose programming language Developed in 1972 at Bell Labs by Dennis Ritchie Foundation of modern languages (C++, Java, Python, etc.) Used in operating systems, compilers, microcontrollers, embedded systems It is a high-level language
First C program structure
Types of Constants Integer Constants Real Constants Character Constants String Constants
Integer Constants C integer constant is a decimal, octal (Value starts with 0 ) or hexadecimal number (Value starts with 0 x).
Character and String Constants Character Constants must be enclosed with in single quotes. Ex: ‘a’, ‘c’ A string constant is a sequence of characters enclosed in double quotes. “hello”
Variables A variable is an identifier or a name which is used to refer a value and this value can change during the program execution A variable is written with a combination of letters, numbers and special characters Example: x, fact, c 22 , total_value
Data Types Can be divided into 2 categories:
Keywords Keywords are reserved words that have predefined meaning in the C language. You cannot use them as: ◦ variable names ◦ function names ◦ identifiers of any kind Data type keywords: int, float, double, char, void Control flow keywords: if, else, switch, case, default, for, while, do, break, continue Storage / Declaration keywords: const, auto, extern, static, register Other important ones: return, sizeof, typedef, struct, union, enum