Computer Science, asked by nmngupta, 1 year ago

write a programm to claculate %of marks of 40 student using function

Attachments:

helpls: can u use arrays?
nmngupta: no
anirbanroy: Which language?
helpls: java

Answers

Answered by anirbanroy
2
In java : 

import java.util.Scanner;
class Percentage
{
public static void main()
{
Scanner sc=new Scanner(System.in);
int I;
double s=0.0,m,p;
for(I=0;I<40;I++)
{
System.out.println("Enter the marks of the "+I+"student");
m=sc.nextDouble();
s+=m;
}
p=(double)s/40*100;
System.out.println("% is"+p);
}
}


helpls: thank yoy :)
anirbanroy: you're welcome, but, hitting the 'Thanks' button is a better way to appreciate :)
helpls: -_-
Similar questions