We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
importjava.util.Scanner;publicclassSumchallenge{publicstaticvoidmain(Stringargs[]){Scannersc=newScanner(System.in);intsum=0;//int n = sc.nextInt();intcount=1;for(inti=0;i<count;i++){sum=sum+(sc.nextInt());count++;if(count==7){break;}}System.out.println(sum);}}
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →