Reference no: EM132196873
Write C++ programs to perform the following tasks. In many of the program descriptions below, example input and output is provided.
NOTE: You don't need arrays to solve any of these problems. You should NOT use arrays to solve any of these problems.
You should also not use string manipulation beyond extraction from an std::stringstream, if needed.
exclusive.cpp: Let the user input an odd number of positive integers, space separated, on a single line (as seen below).
Assume that each integer except for one, the exclusive integer, appears an even number of times in the input.
Your program should output the exclusive integer. Remember, you do not need nor should you use an array to solve this problem.
You should also not use string manipulation beyond extraction from an std::stringstream, if needed.
Enter integers: 2 1 55 3 2 1 4 4 2 2 55 Exclusive: 3
primesum.cpp: Let the user input a single integer n where 1 = n = 100000.
Your program should print the sum of the first n prime numbers. Remember, you do not need nor should you use an array to solve this problem.
In the first example below, the first 5 prime numbers are 2, 3, 5, 7, and 11.
Enter integer: 5 Prime sum: 28 Enter integer: 100000 Prime sum: 62260698721