Search This Blog

If you have any problem or question please write in the comments. We will try to solve and send you the solution. Not just that we will also post your problems solution on our blog.

Wednesday, 20 April 2011

Java program which shows result of three subjects

import java.util.*;
class result
{
public static void main (String arg[])
{
Scanner in=new Scanner (System.in);
int a,b,c;
System.out.print ("\n\t Enter marks of first subject = ");
a=in.nextInt();
System.out.print ("\n\t Enter marks of second subject = ");
b=in.nextInt();
System.out.print ("\n\t Enter marks of third subject = ");
c=in.nextInt();
int t=a+b+c;
System.out.println ("\n\t Total marks = "+t);
if (t>=250)
System.out.println ("\n\t Good ");
else
System.out.println ("\n\t Fair");
}
}

No comments:

Post a Comment