Info
この質問は閉じられています。 編集または回答するには再度開いてください。
program for bool function for prime number in php
1 回表示 (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
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.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!