Hello,
I have to do a program like this:
We have to introduce a number of numbers. After that, we introduce the numbers. (taken from a file). We sort the prime ones from the non-prime ones (I don't know how are they called in english for sure... the numbers that have only 2 divisors: 1 and themselves). We do the sum of prime ones and we display the sum of the digits of the sum of prime numbers.
Hi,
You have not stated what error/problem are you getting.
Anyways for your prime logic (yes thats what its called in english :) )
your count variable will be executed more than once (as its inside 2 for loops)
I noticed that line 12 only reads the file once to retrieve the number 5. Although useful it is not enough you miss processing 4 11 24 13 97. I have not worked on it yet, but I am thinking of using a while loop to process the rest of the numbers in the file.
Speaking of files the file extensions of .in and .out are OK, but the extension should reflect what type of file it is. In this case .txt for a text file. .in and .out may make sense to you yet could be confusing to others. Just saying.