A C++ program that will calculate the area and perimeter of a rectangle by using the function template template. The area and perimeter are calculated by using following formula:
area = length * width
perimeter = 2 *(length + width)
The program will read the values of length and width from the user trough keyboard and passes these values to the function calculate(T x, T y). The function calculates the area and perimeter of the rectangle and displays the result on the screen. The function returns no value.
2006-07-27
09:10:03
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design