Programming in JAVA.
Java Week 1: Q5
Complete the code segment to find the highest mark and average mark secured by Hari in "s" number of subjects.
PROGRAM:
double sum=arr[0];
int max=arr[0];
for(i=1;i<(arr.length);i++)
{
sum=sum+arr[i];
if(arr[i]>max)
max=arr[i];
}
result=max;
mark_avg=sum/(arr.length);
System.out.println(result);
System.out.print(mark_avg);
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100% correct solutions.
No comments:
Post a Comment
If you have any problems related to solutions or any concept please let me know.