25th Jul 2017, 12:39 PM
shobhit
shobhit - avatar
5 Answers
+ 7
1. sizeof doesn't return the length of array. It returns the total number of bytes of the parameter. Integers are of 4 bytes, and your array contains 11 integers. So sizeof (year) is 44. To get 11, you need to divide it by the size of data type 2. remove the line which prints xi before taking input. https://code.sololearn.com/cBEDEh4NACJ0/?ref=app
25th Jul 2017, 1:02 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 1
@jonas it has an array that have year when cricket world cup was held. now there is a loop which checks whether the integer in the oats meter equal that of the array and if it equal then stop it.
25th Jul 2017, 1:58 PM
shobhit
shobhit - avatar
+ 1
Thank you, but I wanted to know what it is for on general.
25th Jul 2017, 2:13 PM
Jonas Schröter
Jonas Schröter - avatar
0
What should your code do, just for better understanding?
25th Jul 2017, 12:49 PM
Jonas Schröter
Jonas Schröter - avatar
0
yeah its ok.
25th Jul 2017, 2:55 PM
shobhit
shobhit - avatar