Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class simst
- {
- public static void main(String[] args) throws IOException
- {
- BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
- String snm[]=new String[100];
- String a;
- int n;
- Int m[][]=new int[10][20];
- System.out.println("How many students are there?");
- a=br.readLine();
- n=Integer.parseInt(a);
- for(int i=1;i<=n;i++)
- {
- System.out.println("Enter the name of student no:"+i);
- snm[i]=br.readLine();
- for(int j=1;j<=2;j++)
- {
- System.out.println("Enter the marks of "+i+"th students of"+j+"th subject");
- a=br.readLine();
- m[i][j]=Integer.parseInt(a);
- }
- }
- System.out.println("\n ");
- System.out.println("\tName\t\t1stSub\t\t2ndSub");
- System.out.println(" ");
- for(int i=1;i<=n;i++)
- {
- System.out.print("\t"+snm[i]);
- for(int j=1;j<=2;j++)
- {
- System.out.print("\t\t"+m[i][j]);
- }
- System.out.println("\n");
- }
- System.out.println(" ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement