Linux C

#include
#include
#include
int main(void) {
int num_rows = 0, num_columns = 0;
setupterm(NULL, fileno(stdout), (int *)0);
num_rows = tigetnum("lines");
num_columns = tigetnum("cols");
printf("terminal:\ncolumns: %d\nrows %d\n", num_columns, num_rows);
return 0;
}