Program to calculate average of 3 numbers

/* Program to calculate average of 3 numbers */

class P1
{
     public static void main(String args[])
     {
             int a, b, c, average;
             a = 3;
         b = 7;
             c = 2 ;
             average = ( a + b + c ) / 3;
             System.out.println(" Average : "+average);
     }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|