Hello. I am new to c programming. I have this assignment that is really hard for me to figure out what to start with and what to do with it.
"Larger Than n
In a program, write a function that accepts three arguments: an array, the size of the array, and a number n . Assume that the array contains integers. The function should display all of the numbers in the array that are greater than the number n."
Could you please help me with this?
Is it right to start off with
void fn(const int* array, int size, int n)?
Any kind of answer would be appreciated. Thank you!
void fn(int* arr, int size, int n){
//write code here
}
Now, you have to search through the array and check if any of the numbers within the array is bigger than the number n.
Assume the number n is equal to 5.
And the array looks like this int arr[4] = {6,7,2,9};
Assuming you know how array works, if you don't it's easy to look it up on youtube and google.
Check each number inside the array and see if it's bigger than 5, if it is just print that number out.
Start working on it, get some code done. If you get stuck please present us with the code and use code tags - http://www.cplusplus.com/articles/jEywvCM9/ And tell us what you think is wrong. Goodluck!