Sunday, August 3, 2014

Positive Or Not


To find Whether the given Number in Positive Or Not




public class PositiveNegative
{
    public void main(int n)
    {
        if (n>0)
        System.out.println("The number is positive");
        else
        System.out.println("The number is negative");
               
    
    }
}

Triangle


TO FIND THE AREA OF THE TRIANGLE



/*TO FIND THE AREA OF THE TRIANGLE
 */
public class TRIANGLE
{
    
    public static void main(String args[])
    {
     int b=10;
     int h=9;
     double area;
     area =0.5*b*h;
     System.out.println("the area of the triangle is" +area);
     
    }
}

Simple Interest

To find the Simple Interest from the given Details



/* TO FIND SIMPLE INTEREST
 */
public class Interest
{
   public static void main(String args[])
   {
    int p=10;
    int t=12;
    int r=43;
    int si;
    double interest;
    si=p*t*r/100;
    System.out.println("Simple Interest is"+si);
    
   
    
  }
}

Greatest

To find which of the entered Number is the Greatest



/* To find which of the 3 numbers are greatest
 */
public class GR8nSmall
{
    public static void main(int a,int b,int c)
    {
        if ((a>b)&&(a>c))
        System.out.println("The Greatest number is"+a);
        if ((b>a)&&(b>c))
        System.out.println("The Greatest number is"+b);
        if ((c>a)&&(c>b))
        System.out.println("The Greatest number is"+c);
        
    }
}

Even Odd

Even Odd



/*TO Find whether the number is Even or Odd
 */
public class EvenOdd
{
  public void main(int n)
  { 
     if (n%2==0)
     System.out.println("The number is even");
     else
     System.out.println("The number is odd");
     
       
  }
}

Area of Circle

Area of Circle




public class Circle
{
    
    public static void main(double r)
    {
        
        area=2*pi*r*r;
        System.out.println("area of a circle is "+ area);
    }

       

}

Hello World

Hello World


// Prints hello World
public class Intro
{
  public static void main(String args[])
  {
      System.out.print("Hello World");
    }

    
}
Welcome . I teach java. I am an ICSE student and if u are one too , and you are finding it difficult to understand java, I am the Answer . Wish u all the luck