Question: I need to Write a function in C language whose output with respect to input should like this:

![enter image description here](https://i.stack.imgur.com/byMFL.png)

The above table is just for an example. The input is not limited to 25, and also the number of inputs in a particular range is `X` instead of 5. I cannot figure out how to do this?

Right now I don't have enough time write a better question ;). Please edit it if you found any mistake.

Answer: 
```
int func(int x)
{
    if(x%5 == 0)
        return x/5;
    else
        return x/5 + 1;
}

```
What about an array of structs along

```
struct range {
    int lo, hi, result;
}

```

Ask the user for X, then allocate an array with X instances of this struct,

```
#include <stdlib.h>
struct range *array = malloc (X * sizeof *array);

```

Now loop over X table rows asking for the lo, hi and result. The rest is left as an exercise...