Want this question answered?
Be notified when an answer is posted
Chat with our AI personalities
read num1 read num2 sum = num1 num2 print highest value
num1 <<= 1; /* shift left */
int main() { int num1; int num2; int result = num1 + num2; return 0; }
'*** PROGRAM: Compare 2 numbers using both min/max functions; ' then, output which number is max/and, which is min. '*** declare variables... min = 0 max = 0 number1 = 342 number2 = 256 '*** main program... CLS '...(CL)ear the Output (S)creen PRINT "Minimum = "; findMin(number1, number2) PRINT "Maximum = "; findMax(number1, number2) END '...END of program/halt program code execution FUNCTION findMax (num1, num2) answer = 0 IF num1 > num2 THEN answer = num1 ELSE answer = num2 findMax = answer END FUNCTION FUNCTION findMin (num1, num2) answer = 0 IF num1 < num2 THEN answer = num1 ELSE answer = num2 findMin = answer END FUNCTION ---program output... Minimum: 256 Maximum: 342
$vi sum.sh echo "enter the 1st no." read num1 echo "enter the 2nd no." read num2 sum= 'expr $num1 + $num2' echo "sum of the numbers is $sum"