C PROGRAMMING FOR STUDENTS OF PHYSICS HONs. IN WEST BENGAL
(dedicated to students of west bengal state university, calcutta university, kalyani university)
BASICS
c programming is included in 3rd year for physics honours students , students are either provided borland c++ or turbo c++. The programs are more or less same in both compilers , the main()body is almost same , there are only a few minor difference , the programs provided here can be tried on both of these compilers as they would work on both. Students are requested to try the programs and post for error if any in comments.
Types of programs in c
The programs in C are mainly for numerical methods, there are many equations which takes time to be solved by hand and paper, there are lots of datas which takes time to be calculated , so we use C to mainly ease our complication as we would procide the equations and C would compute them for us.
C is used in numerical methods for :-
1. sorting and arranging
2. integraion
3.differentiation
4.generate data for plotting graph
5.calculate mean,median,mode
6.find the solution of a series
SORTING AND ARRANGING
Sorting means to pick up things and arrange in a desired way , we normally use bubble sorting and selection sorting. A sorting program is provided as under
Creating an array of 1D array of any 12 integer numbers(1 to 100)taken as input and arranging them in descending order. Also the number of swaps are counted.
SORTING AND ARRANGING
Sorting means to pick up things and arrange in a desired way , we normally use bubble sorting and selection sorting. A sorting program is provided as under
Creating an array of 1D array of any 12 integer numbers(1 to 100)taken as input and arranging them in descending order. Also the number of swaps are counted.
INTEGRATON
A program to integrate I= cos(x)dx in the limit 0 to pi(180) to determine the optimum value of h using Simpson’s 1/3 rule.
A program to integrate I= cos(x)dx in the limit 0 to pi(180) to determine the optimum value of h using Simpson’s 1/3 rule.
DIFFERENTIATION
A program to compute all four solutions =0 in[0,8] accurate to within O.0001
A program to solve quadratic equation
please wait for more programs there are lots to be added----
Program to generate points for plotting a graph
A program to integrate f(x)=8*x^2 from x=1 to x=2 using Monte Carlo random dot method for 3000,8000,10000 and 15000 random pointsA program to solve quadratic equation
please wait for more programs there are lots to be added----
No comments:
Post a Comment