8

Summing Three Numbers from a File

 2 years ago
source link: http://programmingbydoing.com/a/summing-three-numbers-from-a-file.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Summing Three Numbers from a File
  • Author: Graham Mitchell
  • Filename: SummingThreeNumbersFromAFile.java

Summing Three Numbers from a File

First, create a file in Notepad containing three integers separated by some whitespace. Save it as "3nums.txt" in the same folder as your code.

screenshot of integers typed in Notepad

Then write a program that reads three integers from the file 3nums.txt and displays (on the screen) the total of the integers.

Reading numbers from file "3nums.txt"... done.

3 + 1 + 4 = 8

©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK