PROGRAMMING LABORATORY
Credits
|
Periods
|
Exam
Hrs.
|
Sessional
Marks
|
Exam
Marks
|
Total
Marks
|
|
Theory
|
Tutorial
/ Lab
|
|||||
2
|
-
|
3
|
3
|
50
|
50
|
100
|
1.
Write
a program to read x, y coordinates for 3 points and then calculate the area of
a triangle formed by them and print the coordinates of the three points and the
area of the triangle. What will be the output from your program if the three
given points are in a straight line?
2.
Write
a program, which generates 100 random integers in the range of 1 to 100. Store
them in an array and then print the arrays. Write 3 versions of the program
using different loop constructs. (eg. For, while, and do write).
3.
Write
a set of string manipulation functions e.g. for getting a sub-string from a
given position. Copying one string to another, reversing a string, adding one
string to another.
4.
Write
a program which determines the largest and the smallest number that can be
stored in different data types of like short, int., long, float and double.
What happens when you add 1 to the largest possible integer number that can be
stored.
5.
Write
a program, which generates 100 random real numbers in the range of 10.0 to
20.0, and sort them in descending order.
6.
Write
a function for transposing a square metrix in place (in place means that you
are not allowed to have full temporary matrix).
7.
First
use an editor to create a file with some integer numbers. Now write a program,
which reads these numbers and determines their means and standard deviation.
8.
Given
two points on the surface of the sphere, write a program to determine the
smallest arc length between them.
9.
Implement
bisection method to find the square root of a given number to a given accuracy.
10.
Implement
Newton Raphson method to determine a root of polynomial equation.
11.
given
a table of x and corresponding f(x) values, write a program which will
determine f(x) value at an intermediate x value using Lagrange’s interpolation.
No comments:
Post a Comment