Input Format
The first line contains a single integer , denoting the number of boxes.
 lines follow with three integers on each separated by single spaces   and  which are length, width and height in feet of the -th box.
Output Format
For every box from the input which has a height lesser than  feet, print its volume in a separate line.

hackerrank boxes through a tunnel problem solution in c programming

Boxes through a Tunnel problem solution in C programming | HackerRank

#include <stdio.h>
#include <stdlib.h>
#define MAX_HEIGHT 41

typedef struct {
    int height;
    int length;
    int width;

int get_volume(box b) {
    return b.length * b.height * b.width;

int is_lower_than_max_height(box b) {
    return b.height < 41 ? 1 : 0;

int main()
    int n;
    scanf("%d", &n);
    box *boxes = malloc(n * sizeof(box));
    for (int i = 0; i < n; i++) {
        scanf("%d%d%d", &boxes[i].length, &boxes[i].width, &boxes[i].height);
    for (int i = 0; i < n; i++) {
        if (is_lower_than_max_height(boxes[i])) {
            printf("%d\n", get_volume(boxes[i]));
    return 0;