Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started