public int sum3(int[] nums) { return nums[0] + nums[1] + nums[2]; }
public int sum3(int[] nums) { int sum=0; for(int i=0;i<nums.length;i++) { sum = sum + nums[i]; } return sum;}
cool
public int sum3(int[] nums) { int total = 0; for(int x : nums){ total = total + x; } return total;}
public int sum3(int[] nums) { return nums[0]+nums[1]+nums[2];}
public int sum3(int[] nums) { return (nums[0]+nums[1]+nums[2]);}
If you like our content, feel free to follow me to stay updated.
Enter your email address:
We hate spam as much as you do.
Upload
public int sum3(int[] nums) {
ReplyDeleteint sum=0;
for(int i=0;i<nums.length;i++)
{
sum = sum + nums[i];
}
return sum;
}
cool
Deletepublic int sum3(int[] nums) {
ReplyDeleteint total = 0;
for(int x : nums){
total = total + x;
}
return total;
}
public int sum3(int[] nums) {
ReplyDeletereturn nums[0]+nums[1]+nums[2];
}
public int sum3(int[] nums) {
ReplyDeletereturn (nums[0]+nums[1]+nums[2]);
}