Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

function find_max(nums) { 2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers 3 for (let num of nums) { 4 if (num > max_num) { 5 // (Fill in the missing line here) 6 } 7 } 8 return max_num; 9 }

import java.util.Scanner;
public class Exercise9 {

    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        System.out.print("Input 1st integer: ");
        int firstInt = in.nextInt();
        System.out.print("Input 2nd integer: ");
        int secondInt = in.nextInt();

        System.out.printf("Sum of two integers: %d%n", firstInt + secondInt);
        System.out.printf("Difference of two integers: %d%n", firstInt - secondInt);
        System.out.printf("Product of two integers: %d%n", firstInt * secondInt);
        System.out.printf("Average of two integers: %.2f%n", (double) (firstInt + secondInt) / 2);
        System.out.printf("Distance of two integers: %d%n", Math.abs(firstInt - secondInt));
        System.out.printf("Max integer: %d%n", Math.max(firstInt, secondInt));
        System.out.printf("Min integer: %d%n", Math.min(firstInt, secondInt));
    }
}
Comment

function find_max(nums) { 2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers 3 for (let num of nums) { 4 if (num > max_num) { 5 // (Fill in the missing line here) 6 } 7 } 8 return max_num; 9 }

1 function find_max(nums) {
2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers
3 for (let num of nums) {
4 if (num > max_num) {
5 // (Fill in the missing line here)
6 }
7 }
8 return max_num;
9 }
Comment

PREVIOUS NEXT
Code Example
Javascript :: client.connect is not a function node js mongodb 
Javascript :: You are getting a `numbers` array. Return the sum of **negative** numbers only. //condition to check for negative 
Javascript :: elon musk 4k photo 
Javascript :: using the for of loop in pure javascript to populate data into HTML 
Javascript :: include antoher file wagger 
Javascript :: how to remove document.getElementById("myDropdown").classList.toggle("show"); 
Javascript :: making all makers to show in react native map 
Javascript :: mongoose wont update value in array 
Javascript :: knex muliple like query 
Javascript :: stop monitorevents 
Javascript :: jquery to javascript converter online 
Javascript :: generators javascript in class 
Javascript :: naming a function in javascript 
Javascript :: how to delete an item on click in js 
Javascript :: jsetracker 
Javascript :: setimteout use function generator 
Javascript :: ggufhca spingnift cpwjirbgi bshhv 3 bvvvslit nevkdhaer nhdydg kllojb n 
Javascript :: how to include build script in node js 
Javascript :: How to use wildcard in Jason_VALUE 
Javascript :: react native bordered image drop with shadow fix 
Javascript :: what does god expect of me 
Javascript :: var fn = () = { return new Promise(r = r(5)) } 
Javascript :: get current page rows in tabulator js 
Javascript :: reqeuest body in hapijs 
Javascript :: filter advantages in js 
Javascript :: react addon update 
Javascript :: deploy angular app on google app engine 
Javascript :: bind jquery trough name 
Javascript :: sumoselect select all option 
Javascript :: how to fix eslint jsx not allowed in js 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =