write a program to find AVERAGE of 3 byte type variable

class first
{
public static void main(String args[])
{
byte a=5,b=1,c=2;
float avg=0;
int product = (byte)(a*b*c);
avg=(float)(product/3);
System.out.println("average is= " +avg);
}
}

0 comments:

Post a Comment