Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a C language, and only write a loop equivalent to the for loop on line 40, without using && or ||. Thank you

image text in transcribedimage text in transcribedimage text in transcribed

This is a C language, and only write a loop equivalent to the for loop on line 40, without using && or ||.

Thank you in advance.

Run Debug Stop Save A submit Language C main.c 9 #include 10 11 #define MAXLINE 1000 12 23 13 int getline2(char line[], int maxline); 14 void copy (char to[], char from[]); 15 16 int main() 17- { 18 int len; 19 int max; 20 char line[MAXLINE]; 21 char longest [MAXLINE]; 22 max=0; 24. while((len = getline2(line, MAXLINE)) > 0){ 25 if(len > max){ 26 max = len; 27 copy(longest, line); 28 } 29 } 30 31 if(max > 0) 32 printf("%s", longest); 33 34 return 0; 35 } mmmmm Run Debug Stop A Save A submit Language main.c 30 31 if(max > 0) 32 printf("%s", longest); 33 34 return 0; 35} 36 37. int getline2(char s[], int lim){ 38 int c, i; 39 40 for (i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions