You are on page 1of 6

LAB # 02

LOOPS AND LOGICS


QUESTION # 01:
Write a program to solve quadratic equation using( if, else-if and else)

CODE:

OUTPUT:
QUESTION # 02:
Write a program to generate Fibonacci hypothesis for 19 generations

CODE:

OUTPUT:
QUESTION # 03:
Write a program to read salary of an employee and designate according to their salary using if-
else ladder.

CODE:

OUTPUT:
QUESTION # 04:
Write a Java program to read a number from the user and print whether it is positive or negative.

CODE:

OUTPUT:
QUESTION # 05:
Write a program to read 3 integer values and print the greater and lesser number
respectively

CODE:

OUTPUT:

You might also like