a=input('Sudut awal = ');
b=input('Sudut akhir = ');
c=input('Step = ');
x=a:c:b;
y1=sin(x/180*pi);
y2=cos(x/180*pi);
hasil=[x' y1' y2'];
disp('-----------------------------------------')
disp('Tabel sin(x) dan cos(x)')
disp('-----------------------------------------')
disp(' x sin(x) cos(x)')
disp('-----------------------------------------')
fprintf('%6.0f %12.4f %12.4f\n',hasil')
disp('-----------------------------------------')
Tidak ada komentar:
Posting Komentar