Friday, December 31, 2010

Assignment - 1 -- Scientific And Statistical Computing

Date: 30/12/2010

Scientific and Statistical Computing

Assignment – I

  1. What is Error? Explain different types of errors.
  2. Write a program in C/C++ to calculate factorial of a given number using function.
  3. Write a program in C/C++ to calculate power of a given number using function.
  4. Write a program in C/C++ to calculate the following series.

ex = 1 + x/1! + x2/2! + … + xn/n!

  1. Given sin x = x – x3/3! + x5/5! + …. Write a program in C/C++ to calculate the truncation error in sin x if only first four terms are considered at x = 0.7. Also display relative error.
  2. What are the pitfalls in computing when number are expressed in normalized floating point mode? Illustrate your answer with example.

Submission Date: 10/01/2011