0% found this document useful (1 vote)
100 views4 pages

449 m1 Assign v1

Assignment

Uploaded by

mkasi2k9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
100 views4 pages

449 m1 Assign v1

Assignment

Uploaded by

mkasi2k9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Java Essentials

Introduction to Java
Assignment

© Brain4ce Education Solutions Pvt. Ltd.


Introduction to Java

Introduction to Java
Assignment

Table of Contents
Data Types and Operations..................................................................................................................... 2
if Condition.............................................................................................................................................. 2
for..loop................................................................................................................................................... 2
while..loop .............................................................................................................................................. 3
do..while loop ......................................................................................................................................... 3

© 2014 Brain4ce Education Solutions Pvt. Ltd Page 1


Introduction to Java

Data Types and Operations

 Write programs to use all the data types and given arithmetic operations.
 Write program to perform all the arithmetic operations given in the table.

Arithmetic Operators

+  Addition

-  Subtraction

*  Multiplication

/  Division

++  Increment operator

--  Decrement operator

if Condition

 Write a program to check if a candidate is eligible for voting or not. (Hint: Check age)
 Write a program to check if the number is positive or negative.
 Extend the previous program to check whether the given number is positive, zero or
negative. (Hint: use if-else conditions)
 Write a program to find largest of two numbers.
 Write a program to check given number is even or odd. (Hint: use % operator)

for..loop

 Write a program to print 10 even numbers and 10 odd numbers.


 Write a program to find factorial of a number.
 Write a program to generate tables of 10.
 Write a program to add the digits of a number.
 Write a program to reverse the digits of a number.
 Write a program to generate 10 Fibonacci numbers.

© 2014 Brain4ce Education Solutions Pvt. Ltd Page 2


Introduction to Java

while..loop

 Write a program to print 10 even numbers and 10 odd numbers.


 Write a program to find factorial of a number.
 Write a program to generate tables of 10.
 Write a program to add the digits of a number.
 Write a program to reverse the digits of a number.
 Write a program to generate 10 Fibonacci numbers.

do..while loop

 Write a program to print 10 even numbers and 10 odd numbers.


 Write a program to find factorial of a number.
 Write a program to generate tables of 10.
 Write a program to add the digits of a number.
 Write a program to reverse the digits of a number.
 Write a program to generate 10 Fibonacci numbers.

© 2014 Brain4ce Education Solutions Pvt. Ltd Page 3

You might also like