How do I type the following pseudocode in MATLAB code and wh
How do I type the following pseudocode in MATLAB code and what values will display for the variables?
integer i, j; real c, f, x, half
x <-- 10/3
i <-- integer(x + 1/2)
half <-- 1/2
j <-- integer(half)
c <-- (5/9)(f-32)
f <-- 9/5c +32
Solution
I have taken f as 100 for reference you can change it according to your requirements. because we need to declare the variable before using it in MATLAB. Just copy paste the program below in your MATLAB IDE and enjoy.
x=10/3
f=100
i=int8(x+1/2)
half=1/2
j=int8(half)
c=(5/9)*(f-32)
f=(9/5*c)+32
If you have any doubt just comment below, I will try to help. Thanks
