An enumerated data type is an ordinal data type
that lists the valid data values for a variable of this
The values of the enumerated data type are
constants of type int.
The integer value of the first element of the
There are many mathematical functions in C math
#include <math.h> / requires lm in gcc
double a = 3.0, b = 2.0, c, d, e, f, g;
c = sqrt(a);
d = pow(a,b);
/* 3 squared */
The type char is one of the fundamental types.
Each character is stored in a machine in one byte,
where 256 distinct values can be represented.
When a character is stored in byte, the content can
be thought of as either a character
Instructor: Ahmad Esmaili
Office Location: CS Bldg. Room 210
Office hours: MWF 11:00am-12:00pm,
or by appointment
Email: [email protected]
CSE130 Textbook info
Programming in C
by Stephen Kochan
Sams, Pearson Education,
Is a problem-solving strategy and a programming
methodology that includes the following rules:
- The flow of control must be as simple as possible.
- The construction of a program should be embody
top-down design (stepwise refineme
C Program Format
A name assigned to a variable, function, etc.
Must start with letter or underscore.
Additional characters can be of any
An array is a sequence of data items that are of the same
type, that can be indexed and stored contiguously.
Arrays are used to represent a large number of
The elements of an array are accepted by the use of
Take two data values of the same type and
returns a boolean result (0 for false and 1 for
Any zero value is false and any non-zero
value is considered to be true.
Relational Operators are as follows:
< less than
> greater th