java array out of bounds
//Use index inside the bounds of the array
java array out of bounds
//Use index inside the bounds of the array
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;
}
}
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);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us