Sum of first n positive integers
Given n, find the sum of first n positive integers
Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55
Find the hypotenuse
Given a and b (the two sides of a right-triangle), find c, the hypotenuse.
2日 前
解決済み
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
2日 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.
2日 前
解決済み
Convert Angstrom to Meters
Write a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)
2日 前
解決済み
Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return true if the triangle with sides a, b and c is right-...
2日 前
解決済み
Sum of Two Numbers
Given two integer numbers x and y, calculate their sum and put it in z.
Examples:
Inputs x = 2, y = 4
Output z is 6
...
2日 前
解決済み
MATLAB 101: Basic Calculator
Write a MATLAB function named basic_calculator that accepts two input numbers, A and B, and returns four distinct outputs:
The ...
2日 前
解決済み
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next.
Example input:
x = [10 2];