Using the knowledge in computational language in C++ it is possible to write a code that reprints prints input so that no line is longer than 50 characters.
<h3>Writting the code:</h3>
<em>#include<stdio.h></em>
<em />
<em>int main(int argc, char** argv){</em>
<em> //creating pointer to read a file</em>
<em> FILE * fp;</em>
<em> char * line = NULL;</em>
<em> size_t len = 0;</em>
<em> ssize_t read;</em>
<em> int i=0;</em>
<em> //opening a file</em>
<em> fp = fopen(argv[1], "r");</em>
<em> //handling the error condition</em>
<em> if (fp == NULL){</em>
<em> printf("File not found..!!");</em>
<em> return 0;</em>
<em> }</em>
<em> int moreThan50 =0;</em>
<em> //reading a file line by line</em>
<em> while ((read = getline(&line, &len, fp)) != -1) {</em>
<em> i = 0;</em>
<em> if(read >= 50){</em>
<em> moreThan50++;</em>
<em> }</em>
<em> while(i < read){</em>
<em> if(line[i]!='\n'){</em>
<em> if(i%50 == 0){</em>
<em> printf("\n%c",line[i]);</em>
<em> }else{</em>
<em> printf("%c",line[i]);</em>
<em> }</em>
<em> }</em>
<em> i++;</em>
<em> }</em>
<em> }</em>
<em> printf("\nTotal lines over 50 chars: %d\n",moreThan50);</em>
<em> printf("Offending Lines: ");</em>
<em> for(i=1;i<=moreThan50;i++)</em>
<em> printf("%d, ",i);</em>
<em> fclose(fp);</em>
<em> return 0;</em>
<em>}</em>
See more about C++ at brainly.com/question/19705654
#SPJ1