Code:
#include <stdio.h>
//the below statement is a function prototype for Numbers
void Numbers(long *a,long *b,long *c);
int main(void) {
//you can call the function after giving the prototype
long int1=92233720368543;
long int2=92233720368542;
long int3=92233720368541;
//calling the function by using reference
Numbers(&int1,&int2,&int3);
return 0;
}
//Here is the function definition
void Numbers(long *a,long *b,long *c){
//calculating sum
long sum=*a+*b+*c;
printf("Sum: %ld\n",sum);
//calculating average and priting
printf("Average: %ld\n",sum/3);
//code to decide the Largest
if(*a>*b && *a>*c){
printf("Largest: %ld\n",*a);
}else if(*b>*a && *b>*c){
printf("Largest: %ld\n",*b);
}else{
printf("Largest: %ld\n",*c);
}
}
output:
Sum: 276701161105626
Average: 92233720368542
Largest: 92233720368543
Please give it
thumbsup and comment below for any problem in the
answer
Write a function prototype and a function definition for a function called Numbers that takes three...
Write the definition of a function that takes as input the three numbers. The function returns turn if the first number to the power of the second number equals the third number otherwise it returns false. Assume that the three numbers are of type double. Use paw() function for the power.
C++ ( Please Read) Write a function prototype and a function definition called getTotal that receives an array of type double, the number of rows in the array. It returns the total of all elements in the array.
4. Write a C definition (prototype) for a function called power which takes a float and an integer as inputs, and returns a float as a result. 5. Write the body of the function from (4). This function should raise the first argument to the power of the second, by multiplying it by itself that many times (don’t use the inbuilt pow function, write your own). Do not worry about “special” cases like negative powers. Please do Q.5
Write a statement that declares a prototype for a function divide that takes four arguments and returns no value. The first two arguments are of type int. The last two arguments arguments are pointers to int that are set by the function to the quotient and remainder of dividing the first argument by the second argument. The function does not return a value. (C Program)
Using python, Write a function max3 that takes three numbers as its arguments and returns the greatest of these three numbers. Your submitted file for this problem should include (a) function definition, obviously, and (b) the code that calls that function (for this problem you do not have to package that calling code into the main() function although you may if you want to), so that if I run your *.py file it computes and prints something (e.g. few test...
Write a function that takes, as arguments, three numbers, and returns their average. Round the values to the nearest tenth. Name this function calculate Average (p1, p2, p3). For example, >>>calculate Average (2.5, 3.5, 9)
Write the definition code for a function named equation, that takes three numbers, n1, n2 and n3 and returns the value of (n1*n22)-3n2 +n3. Use the Python programming language
Please Use Python and provide explanations!!!! 1. Write a function called multiply_and_print that takes two numbers, multiplies them together, and prints out the sentence '____ times ____ is ____'. Ask the user for two numbers, and call multiply_and_print with their two numbers as arguments. 2.Write a function called roll_dice that rolls two six-sided dice and prints out the result of each die. Call it three times. (Remember, you can import the random module with the statement import random, and then...
Python Script format please! 1. Write a script that takes in three integer numbers from the user, calculates, and displays the sum, average, product, smallest, and largest of the numbers input. Important things to note: a. You cannot use the min() or max() functions, you must provide the logic yourself b. The calculated average must be displayed as an integer value (ex. If the sum of the three values is 7, the average displayed should be 2, not 2.3333). Example:...
3. Write a function that takes, as arguments, three numbers, and returns their average. Round the values to the nearest tenth. Name this function calculate Average (p1, p2, p3). For example, >>>calculate Average (2.5, 3.5, 9) average of those 3 values, using decimal division. Round the values to the nearest tenth. Name your function get Average String (p1, p2, p3). For example, >>>get Average String (1.5, 3.5, 4) should return the string “The average value is 3.0.” Your sentence must...