This programming is done by ChIDE - c programming 1. Write a program that: -prom
ID: 3620955 • Letter: T
Question
This programming is done by ChIDE - c programming
1. Write a program that:
-prompts a user to enter a character, an integer, and a real number
-displays them and their memory locations in the following form:
char = (put value here) at memory location: 0x(hex number whatever it is)
int = (put value here) at memory location: 0x(hex number whatever it is)
double = (put value here) at memory location: 0x(hex number whatever it is)
Include the output from the program to demonstrate that it works.
Include pseudocode or a flowchart for the program.
2. Write a function called ‘swap’ that will swap the values of two variables. For example, if there are two variables, x and y:
int x = 5, y = 10;
then after you call the function swap, x should have the value of 10, and y should have the value of 5.
Demonstrate in a program that calls swap that your function successfully swaps the values of x and y. Note, you are not allowed to use global variables for your program. (Hint: you will need to use pointers to get your function to work.)
3. Write a program that requests a user to enter ten numbers, calculates the average of the numbers, and prints out the numbers and their average. Use an array to store the numbers.
Explanation / Answer
Dear, Since you haven't specified the language giving you in c++ 2. Function void swap(int *x,int *y) { int temp; temp=*x; *x=*y; *y=temp; } 3. #include using namespace std; int main() { int numbers[10]; int sum=0; float avg; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.