The program below is the answer to Liang’s Introduction To Java Programming (9th Edition) Chapter 1 Exercise 1.6.
Question: Write a program that displays the result of 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * Exercise 1.6 - Summation Of A Series<br /> *<br /> */ <br /><br />public class Ex01_06 {<br /><br /> public static void main(String[] args) {<br /><br /> System.out.println("1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = "<br /> + (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9));<br /><br /> }<br />}<br /> |
Click here to see other solutions to Introduction to Java Programming.
1 Comment
Thank you again for all the knowledge you distribute, Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting your site since I always come across interesting articles like this one. Great Job, I greatly appreciate that. Do Keep sharing! Regards.