Lecture1 CSE
Lecture1 CSE
Computer Language
By
Md. Monir Hossain
Lecturer
Department of Computer Science & Engineering
E-mail: monir.hossain.cse@sec.ac.bd
• Attendance 10%
• Performance 10%
• Mid Term 20%
• Final Exam 40%
Recommended Textbook & Resources
1. Programming With C, Byron S Gottfried(Second Edition)
2. Tutorialspoint
Link: https://www.tutorialspoint.com/cprogramming/index.htm
3. Javapoint
Link: https://www.javatpoint.com/c-programming-language-tutorial
4. Programiz
Link: https://www.programiz.com/c-programming
5. Geeksforgeeks
https://www.geeksforgeeks.org/c-programming-language/
Course Objectives
• Programming basics and the fundamentals of C
• Data types in C
• Mathematical and logical operations
• Using if statement and loops
• Arranging data in arrays
• Implementing pointers
• File management and dynamic memory allocation
Phases of Computer Generations
Generations of Evolving
Time-Period
Computer Hardware
First Generation 1940s – 1950s Vacuum Tube Based
#include <stdio.h>
int main() {
printf("Hello C Programming\n");
return 0;
}
Compilation process in C
Tokens in C
A token in C can be defined as the smallest individual element of the
C programming language that is meaningful to the compiler. It is the
basic component of a C program.
Input & Output function
• scanf() function
• The scanf() function is used for input. It reads the input data from
the console.
• printf() function
• The printf() function is used for output. It prints the given statement
to the console.
Variables in C
• A variable is a name of the memory location. It is used to store data.
Its value can be changed, and it can be reused many times.
• It is a way to represent memory location through symbol so that it
can be easily identified.
Example:
int a; Valid variable names: Invalid variable names:
float b;
char c; int a; int 2;
int _ab; int a b;
int a30; int long;
Rules for defining variables
• The first character of an identifier should be either an alphabet or an
underscore, and then it can be followed by any of the character, digit,
or underscore.
• It should not begin with any numerical digit.
• In identifiers, both uppercase and lowercase letters are distinct.
Therefore, we can say that identifiers are case sensitive.
• Commas or blank spaces cannot be specified within an identifier.
• Keywords cannot be represented as an identifier.
• The length of the identifiers should not be more than 31 characters.
• Identifiers should be written in such a way that it is meaningful,
short, and easy to read.
Keywords
A keyword is a reserved word. You cannot use it as a variable name,
constant name, etc. There are only 32 reserved words (keywords) in
the C language.
double
Data Types in C
-type of data stored in a C program. Data types are used while
defining a variable or functions in C.
float 4 byte
double 8 byte
\\ \ character
\? ? character
\a Alert or bell
\b Backspace
\f Form feed
\n Newline
\r Carriage return
\t Horizontal tab
\v Vertical tab