Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

=+6. How satisfied are you with this attitude?

Answered: 1 week ago