Table of ContentsTypes, Operators and Expressions.........................................................................................................1Control Flow..........................................................................................................................................2Functions and Program structure..........................................................................................................3Pointers and Arrays................................................................................................................................5Structures..............................................................................................................................................6Input and Output...................................................................................................................................7Types, Operators and Expressions1.Write a program to convert a given number of days into months and days.2.Write a program to read length and width from the input and compute perimeter and area of the rectangle.
area=length*width; //calculates areaperimeter=2*(length+width);//calculates perimeterprintf("Area is %f and perimeter is%f",area,perimeter);}Output:[[email protected] ~]$ gcc area_peri.c[[email protected] ~]$ ./a.outEnter the length and width of a reactangle:2.5 3Area is 7.500000 and perimeter is11.000000[3.Write a program to read the diameter of the circle and compute the perimeter and area of the circle.4.Write a program to read a floating point number from the standard input and print right most digitof the integral part and left most digit of real part.
real_part=real_part*10;//gives the rightmost digit of intger partr_num=(int)real_part;printf("\n leftmost digit of realpart is %d\n right most digit of integral part is %d",r_num,i_num);return EXIT_SUCCESS;}Output:[[email protected] ~]$ gcc floatir.c[[email protected] ~]$ ./a.outEnter floating type number:1234.56integral part is 1234real part is 0.560059leftmost digit of realpart is 5right most digit of integral part is 4