
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

clear clc a=[2 5 7 9 4 12 5 0 -5 2]; b=sort(a); disp('Smallest value in array= ') b(1,1) disp(' ') z=length(b); disp('Greatest value in array= ') b(1,z) clear clc n=input ('enter the value of n= ') n=n*2; for x=1:2:n a(x)=1; end for x=2:2:n a(x)=0; end a