Skip to main content

Posts

Showing posts with the label Three Variables

MATLAB programming among three Variables

clc clear a=input ( 'A=' ); b=input ( 'B=' ); c=input ( 'C=' ); if a>b if a>b disp ( 'A is greater' ) elseif a||c disp ( 'A=C and greater than B' ) else disp ( 'C is greater' ) end elseif b>c if a||b disp ( 'A=B and greater than C' ) else disp ( 'B is greater' ) end elseif b||c disp ( 'B=C and greater than A' ) else disp ( 'C is greater' ) end (try it)