#include #include int main (){int i;XColor c;Display* d=XOpenDisplay (NULL);int s= DefaultScreen(d) ;for(i=0;i< DisplayCells(d,s) ;i++){c.red =(c.blue+=c.green =0x1234+i<<8);if( XAllocColor(d , DefaultColormap(d,s) ,&c)==0)break;} XCloseDisplay (d);printf( "There %s %d" " available" " cell%s",i ?(i>1?"were" :"was"): "were",i ,i?(i>1? "s\n": "\n"): "s\n") ;}