answersLogoWhite

0


Best Answer

It depends on the script language you are using. In the Korn shell, you can say:

echo -n "Enter the first number: "

read first

echo -n "Enter the second number: "

read second

let third=$first+$second

echo The answer is $third

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In Shell script. How do I ask for and accept two numbers and then calculate the sum of the supplied numbers and display the sum.?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Accept 5 numbers in an array and display it?

Accept 5 numbers in an array and display it.


How do you write the pseudo codes that will accept 7 numbers and display their sum?

Start accept 7 number calculate sum print sum stop


Draw a flowchart to accept five numbers and display the sum of the numbers?

start, inputbox,inputbox,inputbox,inputbox,inputbox,progresh,display,stop 


Draw a flowchart to accept 3 numbers and display the largest number?

draw a flowchart to display the first tenth even number


Flowchart for addition of two numbers?

start accept a,b and c c=a+b display c stop


Draw a flowchart to accept two numbers and check if the first is divisible by the second?

Convert this in flow chart and see if it can help Start Display "Enter 2 numbers" Accept 2 numbers A & B Divide the A with B Is result Zero? ---- No - A is not Dividable with second Yes - A is Dividable with second End


Write a program in COBOL to find the largest of N number?

identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.


Draw a flowchart that will accept radius and display the area of circle?

program that display the area of a circle of a reduce


What Part of speech accept?

'Acceptable' is an adjective: 'He did not display an acceptable standard of behaviour.'


What is the difference between system specification and a software specification?

The specifications for a software application will be what that application needs to be able to do. The designwill be how the software engineers plan to do it.A simple specification may be something like "This application must be able to take two numbers as input and display their sum."The design could be:# Accept two values via command line # Add values # Display sum or...# Display calculator GUI # Accept two values via mouse input # Add values # Display sum


Simple c programs for practice?

Accept a number. Display all numbers from 0 up to it. Example: If input number is 5, output should be 0 1 2 3 4Accept two numbers. Display all numbers between them. Example: If input numbers are 10 and 15, output should be 11 12 13 14Accept a number. Display all even numbers less than that number. Example: If input number is 7, output should be 2 4 6Accept a number and display its multiplication table. Example: If input number is 3, output should be 3 X 1 = 3, 3 X 2 = 6..... [For/while loop needed]Accept a number and find the sum of all numbers from 0 till that number. If input number is 3, output should be 6 (0 + 1 + 2 + 3)Create two int variables a and b, each = 30000. Try to assign c = a +b. Display c. Answer is not 60000. Why?Good luck.


Write a program that will accept two numbers and find their sum anddifferences. If the sum is more than the difference, display the sum otherwisedisplay the difference. Pascal programming?

program SumAndDifference; var num1, num2, sum, difference: integer; begin write('Enter first number: '); read(num1); write('Enter second number: '); read(num2); sum := num1 + num2; difference := num1 - num2; if sum > difference then written('The sum is greater: ', sum) else written('The difference is greater: ', difference); end. This program will prompt the user to enter two numbers, calculate their sum and difference, and then compare the two values. If the sum is greater than the difference, it will display the sum; otherwise, it will display the difference.