Friday, September 12, 2008

C Assignment # 4

C Assignment # 4

1. Write a C program to compute the roots of a quadratic equation ax^2 + bx + c = 0. Coefficients a, b and c will be input by the user using scanf() function.

2. Explain the following terms with reference to C programming, and give suitable examples:
syntax error, logical error, and run-time error.

3. What is the filename extension of a program in C language?

4. Which software do you use to run C programs? Study this software and prepare a report on the following features of this software:
a. Editing Options
b. Debugging options
c. Compiling and running options
d. Window options
e. Environment options.

5. Write a program in C to convert distance in kms to equivalent distance in mts. E.g. if input is 267 kms, output should by 267000 mts. Be careful with the data types you use!

6. Banks pay an interest on the money you keep with them. Assume that the banks compute interest using the simple interest formula I = PRT/100. Compute the amount of money receivable at the end of T years when a principal sum of P is kept at an interest rate of R.

7. How will you modify the above problem if interest is paid using compound interest formula (interest compounded quarterly)? Look up the formula for compound interest on the Net or derive it on your own.
Post a Comment