Beruflich Dokumente
Kultur Dokumente
Computer Programming
Lecture 2 – Introduction to C
Languge
void
20 Feb 2016
UniMAP Sem I-13/14 EKT120: Computer Programming 10
Constants Variable
There are two kinds of variable
Variable that can change during the running
program
Variable that cannot change during the running
program
Constant is variable which can not change
during the program execution.
Example:
const double dPi=3.141592;
2. #include <stdio.h>
int main(){
char name[20];
scanf(“%s”,name);
printf(“Your name is %s”,name);
}
20 Feb 2016 EKT120: Computer Programming 23
Relational and Logical Operators
Previously, relational operator:
>, < >=, <=, == , !=
Previously, logical operator:
&&, ||
Used to control the flow of a program
Usually used as conditions in loops and
branches
20 Feb 2016
UniMAP Sem I-13/14 EKT120: Computer
EKT120: Programming
Computer Programming 39
Program debugging-run time error
snapshot
20 Feb 2016
UniMAP Sem I-13/14 EKT120: Computer
EKT120: Programming
Computer Programming 41
Q&A