Assignment (2)

CS1440 Due Friday Set. 1

 

1.Write a C++ program to compute the sum of the following 6 pairs of numbers:

2 and 5 2345 and 6784 345 and 560

2000 and 456 19856 and 345678 4.5678 and 0.876543

 

Your output should look like this:

2 + 5 = 7

2345 + 6784 = 9129

.

 

Call this program prog21.C.

 

2.Write a program to compute the square root of the following set of numbers:

16 65536 10000.

 

Call this program prog22.C.

 

Submit both programs using script and mail as described in the UNIX tutorial and Lab(1). Please submit a hardcopy before the class begins on the due date. You can combine both programs with their inputs/outputs in one script file.

 

All programs should include the following information before the code starts:

// *******************************************************

// Assignment (#) Due date :

// Brief description of what your program does.

// Last Name, First name

// CS1440 Section ( )

// Inputs: Example : two integers a and b or two real values a and b

// Outputs: The sum of two input values

// Sample Input: 4 8 or 45.67 67.89

// Sample output: 12 or 113.56

// *******************************************************