Sunday, 28 June 2020

program in java to find whether a number is Boolean number or not

boolen value in java discribe in two form 
when any variable that has value of 1 or 0,then these value is also called boolen value
.
Enter user any number  then  you can check these volue of vaiables is boolen or not.
if any vaiable 
 


java program  good example  of check  boolen vaule 

package com.mycompany.testprojects;

/**
 *
 * @author rajesh shukla
 */
import java.util.Scanner;
public class boolenornot {
    public static void main(String args[])
    {
        int num;
       Scanner sc = new Scanner(System.in);
       System.out.println("Enter any number");
       num=sc.nextInt();
       if((num==0)||(num==1))
       {
           System.out.println("Enter number is boolen value");
       }
       else
       {
           System.out.println("Enter value is not boolen value");
       }
    }
}


0 comments:

Post a Comment