-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.java
More file actions
35 lines (30 loc) · 699 Bytes
/
student.java
File metadata and controls
35 lines (30 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.util.*;
class student
{
public static void main(String args[])
{
student obj= new student();
obj.read();
}
void read()
{
Scanner ob = new Scanner(System.in);
int m[] = new int[5];
System.out.println("enter the roll number");
int r = ob.nextInt();
for(int i = 0;i<5;i++)
{
System.out.println("enter the mark of subject "+(i+1));
m[i] = ob.nextInt();
}
display(m,r);
}
void display(int m[],int r)
{
System.out.println("roll number"+r);
for(int i = 0;i<5;i++)
{
System.out.println("mark of subject "+(i+1)+"is"+m[i]);
}
}
}