Question: Compare the word apple to pear using C-programming. What is missing on line 7 and 9? Why doesnt it read the char? Can you debug

Compare the word apple to pear using C-programming. What is missing on line 7 and 9? Why doesnt it read the char? Can you debug this for me so that it runs smoothly? Thanks  Compare the word apple to pear using C-programming. What is missing

main.c Esaved #include clang version 6.0.0-1 exit status 1 main.c:10:19: error: char apple[5] a,p 2 3 int main() 4 5 /correctly define array 6 //char apple[5); 7 char apple [5a, p,p,1,e; 8 /char pear[4] main.c:10:23: error: char apple[5] a,p main.c:10:21: note: p char apple[5] a,p 9 char pear[5]: p,e,a, r; 10 1/compare first letter 11 1/compare apple [0] to pear[0] 12 //if apple [1peartO] then they are the main.c:12:17: error: char pear[5];-p,e main.c:12:23: error: same fruit char pear[5]; p,e 13 /define first letter for each then compare that main.c:12:25:error: 14 IIlength of word comparison 15 //if (compare; equal, length, array) 16 if (apple [01pear[0]); char pear[5]; -p,e 5 errors generated. 18 /then 19 20 11 21 22 return 0; 23 printf ("They are the same fruit")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!