Answers for "create an array loop"

5

for loop on a array

var array = [1, 2, 3, 4, 5];
// made an array

for (var i = 0; array[i]; i++) // browse your array with this simple condition on index
	console.log('element '+i+' = '+array[i]);

//output:
element 0 = 1
element 1 = 2
element 2 = 3
element 3 = 4
element 4 = 5
Posted by: Guest on August-04-2021
1

loop array

char s1[] = "Semester 1.";	char s2[] = "Semester 2.";		if (strncmp(s1, s2, 10) == 0)		printf("Equal\n");	else		printf("Not equal\n"); }
Posted by: Guest on September-30-2021

Code answers related to "create an array loop"

Browse Popular Code Answers by Language