java program to find sum array element

java program to take user input

simple java array program

Program:-

import java.util.Scanner;
class group{
public static void main(String arng[]){
int total = 0;
int sum[]=new int[5];
Scanner data = new Scanner(System.in);

System.out.println("Enter 5 element of array");

for(int i=0; i<5;i++)
sum[i] = data.nextInt();
for(int i=0; i<5;i++)
total = total +sum[i];
System.out.println("Sum of array element is:"+total);
}
}

Output:-

Enter 5 elment of array
25
21
23
21
24
Sum of array element is:114

Learn Java:-
Java codes

Java Programs:-
List of Java Programs

48 Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. I really enjoyed reading the Post. It was very informative and useful.
    Best Software Training institute in bangalore
    Best SAP Training institute In Bangalore.
    <a href="http://www.riainstitute.co.in/Advanced-Excel-Training-in-Bangalore.html>Best Advanced Excel Training Institute In Bangalore. </a>

    ReplyDelete
  3. • It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.
    Dotnet Training in Marathahalli

    ReplyDelete
  4. Those rules moreover attempted to wind up plainly a decent approach to perceive that other individuals online have the indistinguishable enthusiasm like mine to get a handle on incredible arrangement more around this condition
    rprogramming training in chennai

    ReplyDelete
  5. I wish to show thanks to you just for bailing me out of this particular trouble.As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.

    java training in bangalore

    ReplyDelete
  6. Appreciating the persistence you put into your blog and detailed
    information you provide.
    dotnet training in bangalore

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here. python training in bangalore

    ReplyDelete
  9. • It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    fire safety training in chennai

    ReplyDelete
  10. I wish to indicate because of you only to bail me out of this specific trouble. As a consequence of checking through the net and meeting systems that were not beneficial, I thought my life was finished.fire and safety courses in chennai

    ReplyDelete
  11. Best R Programming Training in Bangalore offered by myTectra. India's No.1 R Programming Training Institute. Classroom, Online and Corporate training in R Programming
    r programming training

    ReplyDelete
  12. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.
    Also Read : R Programming institutes in Chennai | R Programming Training in Chennai

    ReplyDelete

  13. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums. big data training in Velachery | Hadoop Training in Chennai | big data Hadoop training and certification in Chennai | Big data course fees

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Really useful information. Thank you so much for sharing.It will help everyone.Keep Post.
    R Training Institute in Chennai | R Programming Training in Chennai

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Attend The Best Python Training in Bangalore From ExcelR. Practical Python Training in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Best Python Training in Bangalore.

    ReplyDelete
  18. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Dot Net training in Electronic City

    ReplyDelete
  19. Attend The Data Analytics Courses in Bangalore From ExcelR. Practical Data Analytics Courses in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Courses in Bangalore.
    ExcelR Data Analytics Courses in Bangalore

    ReplyDelete
  20. When i was read your blog, it was so interesting to read & i feel thanks to you for posting such a good blog, keep updates regularly!! Machine Learning Course Bangalore

    ReplyDelete
  21. I learned World's Trending Technology from certified experts for free of cost. I Got a job in decent Top MNC Company with handsome 14 LPA salary, I have learned the World's Trending Technology from Big data training in btm experts who know advanced concepts which can help to solve any type of Real-time issues in the field of Big data. Really worth trying

    ReplyDelete
  22. Great blog thanks for sharing Online marketing has changed how businesses run and succeed in today’s highly competitive world. With Adhuntt Media, your E-commerce store can reach for the stars and find the right customers. Our team of marketing analysts can analyze, strategize and implement the perfect path for you to take to beat your competition and come out as #1. Why talk about it when you can start right here at Adhuntt Media.
    digital marketing company in chennai

    ReplyDelete
  23. Nice blog thanks for sharing Karuna Nursery Gardens provides you with the best nursery solutions for setting you up with a glamorous landscape. That’s right, you have finally found the perfect nursery to set you up with the best house garden in Chennai.
    plant nursery in chennai

    ReplyDelete
  24. Excellent blog thanks for sharing Looking for the best place in Chennai to get your cosmetics at wholesale? The Pixies Beauty Shop is the premium wholesale cosmetics shop in Chennai that has all the international brands your salon deserves.
    beauty Shop in Chennai

    ReplyDelete

  25. I loved reading your post because of clear font style and size.Very helpful content for readers.Thanks for posting.Enroll in big data courses and get placement assistant.Big data refers to the large, diverse sets of information that grow at ever-increasing rates
    big data training institute in btm

    ReplyDelete

Add your comments here

Back to Top