Arrays

Preview:

DESCRIPTION

java related arrays with examples

Citation preview

ArraysSingle Dimensional Array:Syntax:Int marks[]={50,60,55,67,70};Program:Write a program which accepts the marks of a student into a ID array from the keyboard and finds total marks and percentage.Import java.io.*;Class Arr2{Public static void main(String args[])throws IOException{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));InputStreamReader(System.in));System.out.print(How many subjects?);Int n=Integer.parseInt(br.readLine());Int[] marks=new int[n];for(int i=0;i

Recommended