Once the logical expression a t the start of a while loop is

Once the logical expression a t the start of a while loop is false, the statements after the end statement are executed. A. True B. False Answer: Write a MATLAB program to sum the following series with 500 terms by using for loops. 1/1^2 middot 3^2 + 1/3^2 middot 5^2 + 1/5^2 middot 7^2 ...

Solution

4. Sum of Series

Code:

sum=0;
for n=1:999
if rem(n,2)!=0
sum=sum+1/(n*n*(n+2)*(n+2));
end
end
fprintf(\'%i\ \', sum);

5. factorial using while loop:

code:

n=10;
fact=1;
while n>0;
fact=fact*n;
n=n-1;
end
fprintf(\'%i\ \', fact);

 Once the logical expression a t the start of a while loop is false, the statements after the end statement are executed. A. True B. False Answer: Write a MATLA

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site