Search This Blog

UI/UX Design | Web Development | Mobile Application Development

Whether you need UI/ UX design, web development services, or mobile app development services, Qaabil Digitals will be more than happy to help you. We work with top software developers, designers, and project managers. We tailor our services to suit your exact needs. We closely look at your company, listen to your story, and bring about the best ideas and solutions that can help you drive solid results. We don’t just produce work that works. We produce work that matters. Get a quote now Or Talk to us

Wednesday 22 June 2011

Java program using OR opeator


import java.util.*;
class usingor
{
public static void main (String arg[])
{
Scanner in = new Scanner (System.in);

int a,b;

System.out.print ("\n\t Enter value of a = ");
a=in.nextInt();

System.out.print ("\n\t Enter value of b = ");
b=in.nextInt();

if (a<=10 || a<b)
System.out.println ("\n\t a is less then b or 10 ");
if (b>=25 || b==a)
System.out.println ("\n\t b is greater than 25 or equal to a ");

}
}

Note:
          In the above program, after you entered values of variables, first statement will be executed 
  • If 'a' is less than or equal to 10 
          OR
  • 'a' is less than 'b'
          and second statement will be executed in this case
  • If 'b' is greater than or equal to 25
          OR
  • 'b' is equal to 'a'

    No comments:

    Post a Comment

    Share