// filling the blocks according to given specification #include int fillblocks(int n){ if (n==1) return 1;//base cases if (n==2) return 2;//base cases else return fillblocks(n-1) +fillblocks(n-2);// this is recursive because if we put one block vertically then n-1x2 will remain to be filled and if we put 2 blocks horizontally then n-2x1 will be remaining to fill. return 1; } int main(){ int n=20; int no_of_ways= fillblocks(n); printf("Number of ways to arrange the blocks in a board of size %d x 2 is %d. \n", n, no_of_ways); return 0; }