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
3 Answers
+ 3
Please use appropriate and relevant words in thread tags â
+ 2
yeah Avinesh is right. If you declare an array of size n then index goes from 0 to n-1
+ 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.