CSE102 - Week2
CSE102 - Week2
CSE102 - Week2
Faculty of Computing
Department of Computer Science
CSE 102
PRINCIPLES OF PROGRAMMING
defined by classes
Non-Object oriented: eight primitive (also
int 32 –2,147,483,648 to
2,147,483,647
Long 64 –9,223,372,036,854,775,808 to
9,223,372,036,854,775,807
The most commonly used integer type is
int.
Variables of type int are often employed to
wide.
double is the most commonly used because all of the
types.
The way each literal is represented depends upon
its type.
As explained earlier, character constants are
For
example, 11.123 is a floating-point
constant.
By default, integer literals are of type
int.
If
you want to specify a long literal,
append an l or an L.
inner scope.
type int.
b) Assign 1 to variable x.
c) Assign 0 to variable sum.
d) Add variable x to variable sum, and