Cognizant interview question

Pattern problem in c and DBMS