Question: Write a program called p1.cpp that defines three integer variables, and initializes them with three different values. It should then output the values of the
- Write a program called p1.cpp that defines three integer variables, and initializes them with three different values. It should then output the values of the three variables, their sum, and their average. (Hint: Use printf.)
- Write a program called p2.cpp that prompts the user for three integer variables. It should then output the values of the three variables, their sum, and their average. (Hint: Use printf and scanf.)
- Write a program called p3.cpp that reads in three integer variables from an ordinary ASCII text file. It should then output the values of the three variables, their sum, and their average. (Note: You must use fscanf, and you must handle the cases (simply using asserts) when (i) the file doesn't exist, and (ii) there are less than 3 ints in the file.)
- all written in c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
