answersLogoWhite

0


Best Answer

This smells like homework, so I'll only give you pseudo-code:

decimal returnLargest(decimal a, decimal b)

is a > b ? then, return a, else, return b;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to Write a C function which accepts two integer parameters a and b and returns the larger of the two?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a function prototype named test that accepts two parameters an integer and character and returns a float?

float test(int, char);


Design a function named max that accepts two integer values as arguments and returns the value that is greater of the two For example if 7 and 12 are passed as arguments to the function the function?

The function already exists in PHP and is even called max(); Otherwise use: function max ($one, $two) { return $one > $two ? $one : $two; }


What is function calling in c plus plus?

Function calling is where your code branches off to execute a function and then returns to the instruction following the call. The function may also return a value that can be stored and/or processed by the code that called it. Functions allow common code to be separated from the code that uses the common code, thus reducing maintenance (the code in the function is written once, rather than every time it is required).


Which take a string as input and find its length?

strlen is the C library function that accepts a pointer to a char array and returns an integer specifying the number of characters (in bytes) of the array. This function is usually not used any more, because it does not support multi-byte characters, such as UTF-8.


How do you Write a function prototype for a function named printStars that accepts no arguments and returns no data?

void printStarts (void);


Write a method header for a method named find that takes a String and a double as parameters and returns an integer?

int find(String str, double d);


What is the use of void data types?

When a function declares it returns void, it means it does not return anything. Sometimes the function doesn't need to return anything, so using void is convenient. In C: using voidinstead of parameters means 'there's no parameters'


How would you write a function prototype for a function named calcAreaReact that accepts two arguments width and length and returns the area.?

double calcAreaRect (double a, double b);


What is the function of plus sign?

The "plus sign" (+) is an operator that, by default, takes the left and right operands as parameters, and returns the sum of both operands as the return value.


Does a function that takes a value or values and performs an operation return a result to the caller?

Not necessarily. A function that accepts one or more arguments may process those arguments but need not return any value to the caller. In this case the function simply returns void.


1 write a c function that takes a parameters two integer arrays and their sizeboth arrays are of the same size and returns a 1true if the arrays have the same contents or a 0 false if not?

int comp(const int a1[], const int a2[], const int size) { int i; for(i = 0; i < size; ++i) { if(a1[i] != a2[i]) { return 0; } } return 1; }


A function takes the exponential function's output and returns the exponential function's input?

A __________ function takes the exponential function's output and returns the exponential function's input.