programming language, designed to add
interactivity to HTML pages.
that scripts execute without preliminary
10.1 String literals
and "xyz123" are string literals.
printf( "Input a value" ) ;
printf( "The result is" ) ;
stored in memory as:
Terminating null character
printf( "\"I love C,\" said the s
Changes the order of statement execution in a code.
a) Branching constructs
3. If-else if
b) Iteration constructs
The if Construct
Implements a set of ac
CSEB134 LAB TEST 1 QUESTIONS
Write a complete C program that will help a company to adjust salary of its employees.
The program should:
First request for the salary
Then request for P - if Part-time, F - if Full-time
If the employee is w
Introducing the Concept of Programming
Programming is a process of developing the Computer
A program is a set of instructions that computer follows to
do a certain task i.e. Perform a computation
CIT 014 Introduction to
Before writing the computer program, one
must be clear about the processing steps
to be performed by the computer
To produce an ef
A computer program is one or more instructions
that are intended for execution by a computer.
Computer programs may result from the compil
Program example P7A
<- ages ->
Program example P7B
Please enter the ages of ten people
The average age is 48
int ages ; <- ages as an array of ten integers.
Data Structure and
ADT and Introduction to Object
Oriented Programming (OOP)
Introduction to Object Oriented
this lecture you will learn the general
concepts of Object Oriented P
C Data Types
1. Which of the following are valid variable names? If valid, do you think the name is a
good mnemonic (i.e. reminds you of its purpose)?
Keyboard Input and Screen Output
Note: Question 5, 6 and 8are the lab exercise for this week (November 9-13), will only mark
this questions during the lab session.
1. What is wrong with this program?
User Defined Functions
Defining Own Functions
function functionname([parameter list])
Declared in the head section of a html
Example: program to input four numbers use a function to calculate the
CIT 713: Programming C
by Feruzi EK
what is a loop?
loop is a section
of program that is
and over until
some condition is
types of looping?
is two types of
is a composite variable, which can hold more
than one value, at a time.
can hold all your variable values under a single
Each element in the array has its own ID.
Creating an Array
1: regular array (add an optiona
Control Statements: if and switch
1. Rewrite the following ifelse using a switch statement:
Arrays of Matrix
const int MAX = 3;
/initialize the matrix mat with 0
for(int i=0; i<MAX; i+)
The Study of Algorithms
Copyright 2005 Department of Computer & Information
By the end of this lecture you should
Understand the role of a computer
as a tool in Computer Science.
Understand Computer Science as