Professional Documents
Culture Documents
ECE201
Lecture 1
Omar M. Saad
C LANGUAGE.
Why Learn C?
It is one of the most popular programming language in the
world.
dev c++.
Line 1: #include <stdio.h> is a header file library that lets us work with input and output
functions, such as printf() (used in line 4).
Line 2: A blank line. C ignores white space. But we use it to make the code more readable.
Line 3: Another thing that always appear in a C program, is main(). This is called a function.
Any code inside its curly brackets {} will be executed.
Line 4: printf() is a function used to output/print text to the screen. In our example it will
output "Hello World".
Remember: The compiler ignores white spaces. However, multiple lines makes the code more
readable.
Line 6: Do not forget to add the closing curly bracket } to actually end the main function.
C Identifiers
Identifier refers to name given to entities such as variables, functions,
structures etc.
Identifiers must be unique. They are created to give a unique name to an
entity to identify it during the execution of the program. For example:
Here, the type of number variable is int. You cannot assign a floating-point (decimal)
value 5.5 to this variable.
Also, you cannot redefine the data type of the variable to double.
By the way, to store the decimal values in C, you need to declare its type to
either double or float.