0
Find the number of elements in an array without using inbuilt functions
if user enters 1,2,3,4,5 the output should be 5 (without using string.length or any inbuilt functions)
2 Answers
+ 9
// There you go! I didn't take any input here but the method works ;D
int[] arr = {2, 9, 12, 4, 6};
int count = 0;
for(int i : arr) {
count++;
}
System.out.print(count);
0
This can help you.
https://www.sololearn.com/discuss/2568109/?ref=app