+ 5

How should i accept inputs in the following program?

help pls:-) https://code.sololearn.com/cm14swVMJ8yi/?ref=app

9th Nov 2018, 9:23 AM
Abhay
Abhay - avatar
8 Antworten
+ 3
The logic is good. It works if you correct the following syntax errors: - Extraneous opening brace after long int variable declaration in main() - Extraneous semicolon after for() statement in main() - Wrong array name a[] used instead of b[] in for() loop in searchnum() - Extraneous closing brace after return i; in searchnum() - Warnings about misleading indentation To test, I entered values in the following way: 2 3 5 5 The result correctly stated: 5 is present at location 1.
10th Nov 2018, 1:50 PM
Brian
Brian - avatar
+ 1
anyone who can answer !:-)
9th Nov 2018, 1:52 PM
Abhay
Abhay - avatar
+ 1
What do you mean? Your program doesn't work because there are a bunch of stray characters instead of spaces all over your program ( may not be visible on the mobile version ).
9th Nov 2018, 2:17 PM
Dennis
Dennis - avatar
+ 1
oh ,yea they aren't available on mobile ,thks I will write it again
10th Nov 2018, 8:54 AM
Abhay
Abhay - avatar
+ 1
I'll check when I get home :)
10th Nov 2018, 12:24 PM
Dennis
Dennis - avatar
+ 1
ok thks
10th Nov 2018, 1:46 PM
Abhay
Abhay - avatar
+ 1
thks Brian
10th Nov 2018, 5:10 PM
Abhay
Abhay - avatar
0
now see it ,still two errors
10th Nov 2018, 12:12 PM
Abhay
Abhay - avatar