Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% 4.
- n=input('Enter n: ');
- res = prod(n:-2:1);
- if res>1e200
- disp ('Perepolnenye')
- end
- disp ('Double factorial of n = ')
- disp (res)
- %%
- %% 5.
- rnum = randi(10);
- n = input('Enter number to guess: ');
- if (n == rnum)
- disp('You have guessed the number! ')
- elseif(n ~= rnum)
- disp('You have not guessed the number! ;(')
- end
- disp('Right answer is ')
- disp(rnum)
- %%
- %% 6.
- n = input('Enter number to guess (1 to 10): ');
- for rnum = 1:10
- if (rnum == n)
- disp('Number you have entered is: ')
- disp(rnum)
- break;
- end
- end
- %%
- %% 7.
- m=input('Row: ')
- n=input('Column:')
- if (m~=n)
- disp ('Matritsa ne kvadratnaya')
- elseif (m == n)
- for i=1:m
- for j=1:n
- a(i,j)=input('elements-')
- end
- end
- disp('Rank of matrix is: ')
- rank(a)
- end
- %%
Add Comment
Please, Sign In to add comment