Exercise 2-2. Write a loop equivalent to the for loop (my_getline_V01) below without using && or || (my_getline_V02).
/* Exercise 2-2. Write a loop equivalent to the for loop (my_getline_V01) below without using && or || (my_getline_V02). */#include<stdio.h>#define MAXLINE 1000 /* maximum input line length */#define VERSION 2 /* change the version number to either 1 or 2 */intgetline_V01(charline1[],intmaxline1);intgetline_V02(charline2[],intmaxline2);/* print the input line length */intmain(){intlen_V01,len_V02;/* line length */len_V01=len_V02=0;charline[MAXLINE];/* current input line */if(VERSION==1){len_V01=getline_V01(line,MAXLINE);printf("Line length by V01 : %d\n",len_V01);}elseif(VERSION==2){len_V02=getline_V02(line,MAXLINE);printf("Line length by V02 : %d\n",len_V02);}elseprintf("Entered version number is not correct\n");return0;}/* getline_V01: read a line into s, return length */intgetline_V01(chars1[],intlim1){intc1,i1;for(i1=0;i1<lim1-1&&(c1=getchar())!=EOF&&c1!='\n';i1++)s1[i1]=c1;if(c1=='\n'){s1[i1]=c1;++i1;}s1[i1]='\0';returni1;}/* getline_V02: read a line into s, return length without using && or || */intgetline_V02(chars2[],intlim2){intc2,i2;for(i2=0;i2<lim2-1;i2++){if((c2=getchar())!=EOF)if(c2!='\n')s2[i2]=c2;elsebreak;elsebreak;}if(c2=='\n'){s2[i2]=c2;++i2;}s2[i2]='\0';returni2;}