Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

program for bool function for prime number in php

조회 수: 1 (최근 30일)
idogun owolemi charles
idogun owolemi charles 2016년 5월 12일
마감: Stephen23 2016년 5월 12일
To show our interest in both, we are going to write two functions:
• bool isPrime (int) This function will take an integer as an argument and return TRUE or FALSE depending on whether the number is prime or not.
• float primeAverage (int, int) This function will take 2 integers as parameter and return the average of all the prime numbers between the two. Note that the parameters can be in any order.
Implement both functions and provide test scenarios (including output) to the functions.

답변 (1개)

Elias Gule
Elias Gule 2016년 5월 12일
You can use Matlab's standard functions "isprime" and "primes". To view the Matlab code for each type "edit FUNCNAME" in the command window. For example to view the code for "isprime.m", type:
edit isprime
then press Enter.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by