Sie sind auf Seite 1von 2

1.Write a program to print "Welcome to Java" on the console.

2.Write a program to demonstrate primitive Data Types


a)Create variables of each data type, assign legal values to them and print th
eir values.
b)Create variables of each data type, assign illegal(out of range) values to t
hem and see their behavior(or what type of error you get)
=========
OPERATORS
=========
3.Write a program to demonstrate Arithmetic Operators( +, -, *, / and %) on int
data
4.Write a program to demonstrate Arithmetic Operators( +, -, *, / and %) on floa
t data
5.Write a program to demonstrate Assignment Operator
a)Demonstrate correct usage of Assignment Operator
b)Demonstrate incorrect usage of Assignment Operator(eg: x + y = z) and see th
eir behavior(or what type of error you get)
6.Write a program to demonstrate Arithmetic Compound Assignment Operators ( +=,
-=, *=, /=, %=)
7.Write a program to demonstrate Unary Operators ( +, -, ++, --)
a) Demonstrate usage of Unary plus operator(+)
b) Demonstrate usage of Unary minus operator(+)
c) Demonstrate usage of Increment operator(++) when used alone or in isolation
(eg : x++ and ++x)
d) Demonstrate usage of Increment operator(++) when used in an expression (eg
: y = x++ or b = ++a)
e) Demonstrate usage of Decrement operator(--) when used alone or in isolation
(eg : x-- and --x)
f) Demonstrate usage of Decrement operator(--) when used in an expression (eg
: y = x-- or b = --a)
8.Write a program to demonstrate Relational Operators
9.Write a program to demonstrate Logical Operators
10.Write a program to demonstrate Conditional Operators
==================
CONTROL STATEMENTS
==================
11.Write a program to demonstrate if statement
12.Write a program to demonstrate if statement without braces
13.Write a program to demonstrate nested-if statement
14.Write a program to demonstrate if-else statement
15.Write a program to demonstrate nested if-else statement
16.Write a program to demonstrate if-else-if ladder statement
17.Write a program to demonstrate switch statement
a) Use int expression in switch
b) Use char expression in switch
c) Use String expression in switch
d) Observe behavior by using break statement
e) Observe behavior by not using break statement
f) Observe behavior by not using default case
g) Observe behavior by using default case at different places(ie by having it
not necessarily as the last case)
18.Write
19.Write
20.Write
21.Write
22.Write
23.Write

a
a
a
a
a
a

program
program
program
program
program
program

to
to
to
to
to
to

demonstrate
demonstrate
demonstrate
demonstrate
demonstrate
demonstrate

do-while statement
nested do-while statement
an infinite loop using do-while statement
while statement
nested while statement
an infinite loop using while statement

24.Write a program to
25.Write a program to
26.Write a program to
27.Write a program to
a)in for loop
b)in while loop
c)in do-while loop
28.Write a program to
a)in for loop
b)in while loop
c)in do-while loop

demonstrate
demonstrate
demonstrate
demonstrate

for statement
nested for statement
an infinite loop using for statement
break statement

demonstrate nested for statement

Das könnte Ihnen auch gefallen