0

What is goes wrong in this problem?

I can't get the proper output while running this code. https://code.sololearn.com/cuuw8bid9tvv/?ref=app

28th Apr 2020, 1:28 PM
Murugavel
Murugavel - avatar
3 odpowiedzi
+ 3
Please use appropriate and relevant words in thread tags ☝
29th Apr 2020, 5:23 AM
Ipang
+ 2
yeah Avinesh is right. If you declare an array of size n then index goes from 0 to n-1
28th Apr 2020, 1:56 PM
Alexander Thiem
Alexander Thiem - avatar
+ 1
Your line 7 should be like this- scanf("%d %d",&a[0],&a[1]); You have int a[2] so there are only two elements, you cannot take 3 input values. Also at line 9 make i<2.
28th Apr 2020, 1:40 PM
Avinesh
Avinesh - avatar