if else using

 


// if else using
import java.util.Scanner; // jab user sy input lena ho to Scanner class import karna hoga

public class Main { // ye main class hy



public static void main (String []arg) // main maithod dy
{

Scanner obj = new Scanner(System.in); // Scanner class ka object bn gia (ye standard input k liy jesy Keybor)

int a,b,c; // int data type ka 3 variable bany

System.out.println("--A-- enter first number"); // user ko messeg show kia

a = obj.nextInt(); // user sy 1st number lia or a variable main stor kia

System.out.println("--B-- enter second number"); // user ko messeg show kia

b = obj.nextInt(); //user sy 2nd number lia or b variable main stor kia

/*System.out.println("enter thers number");

c = obj.nextInt();*/



//***************************************************************************
if (a>b){ // agar a ka nuber b ky number sy bari hy to
System.out.println("A-- bari hy --B-- sy" ); //print karo A bari hy B sy
}
else { // is ly ilawa print karo A choti hy b sy
System.out.println("A-- choti hy --B-- sy" );
}


}
}

Comments

Popular posts from this blog

for loop

java code for calculater