1 / 15

More loops

More loops. The percentage of bosses that think that their jokes are “very very funny” is. 3 95 98. This percentage of employees who think that their bosses are “very very funny” is. 3 95 98.

Solomon
Download Presentation

More loops

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. More loops

  2. The percentage of bosses that think that their jokes are “very very funny” is • 3 • 95 • 98

  3. This percentage of employees who think that their bosses are “very very funny” is • 3 • 95 • 98

  4. This percentage of employees think that their bosses are “very very funny” when the boss is conducting the survey is • 3 • 95 • 98

  5. The output of the last line isfor i=1:1:3 for j=1:1:2 s=i*j; endends • 0 • 2 • 6 • 11

  6. The output of the last line iss=5;for i=1:1:3 for j=1:1:2 s=i*j; endends • 1 • 5 • 6 • 11

  7. The output of the last line issum1=0;for i=1:1:3 for j=1:1:3 sum1=sum1+4; endendsum1 • 0 • 4 • 12 • 36

  8. The output of the last line issum1=0;for i=1:1:3 for j=1:1:3 sum1=sum1*2; endendsum1 • 0 • 18 • 64 • 128

  9. The output of the last line issum1=1;for i=1:1:3 for j=1:1:3 sum1=sum1*2; endendsum1 • 0 • 18 • 128 • 512

  10. The output of the last line isi=0;while i<=4 j=i*3; i=i+1;endj • 0 • 5 • 12 • 15

  11. The output of the last line isi=0;while i<=4 i=i+1; j=i*3; endj • 0 • 5 • 12 • 15

  12. The output of the last line isf=inline(′x^2′);sum=f(2)+f(4) • 4 • 6 • 16 • 20

  13. The output of the last line isf=inline(′x^2′);sum=f(2+4) • 6 • 16 • 20 • 36

  14. function out=valfun(f,a,b)% f= function of x% a= input real number% b= input real numberout=(f(a)-b)/5is saved in valfun.m file, what would be the output of the last line of the following test programg=inline(′2*x′)outvalue=valfun(g,3,4) • -2/5 • 2/5 • 6/5 • 6

  15. The output of the last line isfor i =1:1:2 a(i,i)=0;endsum1=0;for i=1:1:2 for j=1:1:2 sum1=sum1+5; endendsum1 • 0 • 5 • 10 • 20

More Related