Q:

Check at least 2 numbers are perfect squares - c program

Output:
1 2 9
1 3 8
1 4 7
1 5 6
2 3 7
2 4 6
3 4 5 

Expected:
1 2 9
1 4 7

I only want to print those arrays which have at least 2 perfect squares in them. 
In the above output, "1 2 9" 1 & 9 are perfect squares, as are 1 and 4. The remaining results get skip or don't print. 
Below is my current code:
#include <stdio.h>
#include <math.h>
int main(void) {
int num;
scanf("%d",&num);
if(num<200)
for(int a = 1; a < num; a++) {
    for(int b = a + 1; b < num; b++) {
        for(int c = b + 1; c < num; c++) {
            if(a + b + c == num) {
                printf("%d %d %d\n", a, b, c);
            }
        }
    }
  }
}

A:

It is a pretty simple task, you just need to check for every {a,b,c} if there are at least two squares in it. It is maybe not the best method to check if a number is a square, but you can write your own function to check it.
#include <stdio.h>
#include <math.h>

int is_square(int x)
{
    for(int i=1;i<=x/i;i++)
    {
        if(i*i==x)
        {
            return 1;
        }
    }

    return 0;
}

int main(void)
{
    int num;
    scanf("%d",&num);
    if(num<200)
    {
        for(int a = 1; a < num; a++)
        {
            for(int b = a + 1; b < num; b++)
            {
                for(int c = b + 1; c < num; c++)
                {
                    if(a + b + c == num && is_square(a) + is_square(b) + is_square(c) >= 2)
                    {
                        printf("%d %d %d\n", a, b, c);
                    }
                }
            }
        }
    }
}

