Adding Two Numbers) Write a program that defines macro SUM with two arguments, x and y, and use SUM to produce the following output: the sum of x and y is 13
Please type answer out fully
#include <stdio.h>
#define SUM(x, y) (x + y)
int main()
{
int x, y;
printf("Enter two numbers: ");
scanf("%d%d", &x, &y);
printf("the sum of x and y is %d\n", SUM(num1, num2));
return 0;
}
Adding Two Numbers) Write a program that defines macro SUM with two arguments, x and y,...
a. write a program that calculates the sum of two numbers x and y and then the program should call the function by address and prints the sum b. write a program that stores 10 integers provided at run time in an array. the program should prompt the user for a random integer exit in the array, the value must be replaced by a-1
Write a complete program that: 1) declares two local integers x and y 2) defines a global structure containing two pointers (xptr,yptr) and an integer (z) 3) Declares a variable (mst) by the type of previous structure 4) requests the values of x and y from the user using only one scanf statement 5) sets the first pointer in the struct to point to x 6) sets the second pointer in the struct to point to y 7) uses the...
use python: Write a program that reads in X whole numbers and outputs (1) the sum of all positive numbers, (2) the sum of all negative numbers, and (3) the sum of all positive and negative numbers. The user can enter the X numbers in any different order every time, and can repeat the program if desired. Sample Run How many numbers would you like to enter? 4 Please enter number 1: 3 Please enter number 2: -4 Please enter...
python
In a program, write a function that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display the number n, the list of numbers, and a sub list of all the numbers in the list that are greater than the number n. Initialize the list and the number n in the main function of your code and call your function, passing the list and number as arguments. Run your code...
Statistics Macro Assignment
Write a macro to find the number of observations, max, min, sum,
average and standard deviation for a column of numbers with any
number of observations starting in cell A1 and proceeding downward.
The number set will be of any length and include negative, zero,
and positive integers. Display the results as shown below. Use the
numbers below as an example.
You may use the key board code “Selection.End(xlDown).Select” if
you wish. Otherwise, use only VBA code...
Write a program that will read a list of numbers and a desired sum, then determine the subset of numbers in the list that yield that sum if such a subset exists. Answer from Data Structures (2nd Edition) Chapter 5.6, Problem 6PP: Does not fully answer the question. Specifically, ". . . then determine the subset of numbers in the list that yield that sum if such a subset exists" is not answered in provided solution. It should show the...
Write a program that will read a list of numbers and a desired sum, then determine the subset of numbers in the list that yield that sum if such a subset exists. Answer from Data Structures (2nd Edition) Using JAVA Chapter 5.6, Problem 6PP: Does not fully answer the question. Specifically, ". . . then determine the subset of numbers in the list that yield that sum if such a subset exists" is not answered in provided solution. It should...
Write a program that will read a list of numbers and a desired sum, then determine the subset of numbers in the list that yield that sum if such a subset exists. Answer from Data Structures (2nd Edition) Chapter 5.6, Problem 6PP: Does not fully answer the question. Specifically, ". . . then determine the subset of numbers in the list that yield that sum if such a subset exists" is not answered in provided solution. It should show the...
write the C++ program to do the following 1. read in 2 numbers as ints 2. calculate the sum, difference, product, and quotient 3. print out the four calculated numbers in the following format the two input numbers are ??? and ??? sum is ???? difference is ???? product is ???? quotient is ?????.?????? where ??? represents the ints and ????.???? represents the decimals. You can have any number of decimal places Example: Assume...