Practicals
Practicals
class Expression
int a=4;
int b=6;
int c=3;
int x=a+b/c;
int y=b-c*a;
Output:
Practical no:3
If statement:
public class Ifstatement
int age=20;
if(age>18){
Output:
If else statement:
public class LeapYearExample {
int year=2020;
System.out.println("LEAP YEAR");
else{
System.out.println("COMMON YEAR");
Output:
Nested if statement:
public class JavaNestedIf {
int age=20;
int weight=80;
if(age>=18){
if(weight>50){
}}
Output:
Do while statement:
public class GFG {
int c = 1;
do {
c++;
Output: