Answers for "Array Index Out Of Bounds Exception"

1

java array out of bounds

//Use index inside the bounds of the array
Posted by: Guest on April-25-2020
0

Array Index Out Of Bounds Exception

for(i = 1; i <= height.length; i++){
        heightAsString = JOptionPane.showInputDialog("Please Enter The Height Of Person " + i);
        height[i-1] = Double.parseDouble(heightAsString);

        if(height[i-1] > 1.8){
            over18 += 1;
        }

        if(height[i-1] < 1.6){
            under16 += 1;
        }
    }
Posted by: Guest on September-02-2021
0

error in array

#include <stdio.h>
int main()
{
	char a[20],b[10]= "String",c[8]={'S','t','r','i','n','g','\0'};
	int i;
	for(i=0;c[i]!='\0';i++){
	
	printf("%c",&c[i]);}
	printf("%s",b);
    puts(b);
    	printf("enter the string first scanf and then gets");
    	scanf("%s",a);
    	gets(a);
}#include <stdio.h>
int main()
{
	char a[20],b[10]= "String",c[8]={'S','t','r','i','n','g','\0'};
	int i;
	for(i=0;c[i]!='\0';i++){
	
	printf("%c",&c[i]);}
	printf("%s",b);
    puts(b);
    	printf("enter the string first scanf and then gets");
    	scanf("%s",a);
    	gets(a);
}
Posted by: Guest on April-28-2020

Code answers related to "Array Index Out Of Bounds Exception"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language