IGNOU - MCSL025 - SECTION04 - [S01_E04]

♠ Posted by Unknown in , at 05:27

IGNOU - MCSL025 - SECTION04 - [S01_E04]

/*Author: Viral Vyas
 *Write a program in Java to find the average of mark you obtaind 
 * in your 10+2 class.
 */
package mcsl025;
import java.io.*;
import java.lang.*;

public class S01E04 {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(
        System.out.print("Enter Total Marks of HSC : ");



        
        double mssc, mhsc, avg;

                new InputStreamReader(System.in));
        
        System.out.print("Enter Total Marks of SSC : ");
        mssc = Double.parseDouble(br.readLine());

        mhsc = Double.parseDouble(br.readLine());
        
        avg = (mssc + mhsc) / 2;
        
        System.out.println("Average Marks of [10+2] : " + avg);               
    }
}

Output:

Enter Total Marks of SSC : 778
Enter Total Marks of HSC : 887
Average Marks of [10+2] : 832.5

0 comments:

Post a Comment