2: Write a program to find and print the average of given subjects
and show the output (input : subl=95, sub2 = 82, sub3= 85) in computer
Answers
Answered by
0
Answer:
Here is your answer...
I'm writing only main program with the help of java language...
System.out.print("Input subjects");
int sub1 =Integer.parseInt(br.readline());
int sub2 =Integer.parseInt(br.readline());
int sub3 =Integer.parseInt(br.readline());
float average = (sub1+sub2+sub3)/3.0;
//to print
System.out.print("first subject="+sub1);
System.out.print("second subject="+sub2);
System.out.print("third subject="+sub3);
System.out.print("average of given subject="+average);
HOPE IT WILL HELP YOU!
Similar questions