My goal is to write Readable, self contained solutions that let's one to learn the logic, not taylor piece of jumbling codes for getting output - that's what I felt when I looked into manual linked and I tried too hard to learn from it with vain.
I suggest the starting points as the directory Programs, Each chapter (atleast the One I have modified) have notes + templates that's used for solving excersise as of now,
- Receipe for periodic plots using in-built functions
- A general template for Root finding of function without bracketing roots
- Explains solving ode with numerical techniques Euler, RK2 and RK4 methods
- Extending previous for higher dimensionality
- Receipe for solving Integration and root finding problems
For curiosity - I'm following Kernal source file style
I'm satisfied with how these templates, piece of codes turned out and I was able to explain to myself+my friends, but I would be very happy if someone can dumb it down even further keeping the same essence of learning. Cheers!
finally thanks to musubiie for chapter 2 periodic question and motivation to make templates ;)
Manual by : Professor Shobhit Mahajan >Profile<
Course Instructor : Professor Jyoti Rajput >Profile<
As per our university syllabus, "This course is intended to be an Introduction to a Programming Language C as well as application for Numerical Analysis. The course would impart training in the structure of the programming language as well as train the students in using programs to numerically solve problems in various areas. In addition, it will also familiarize the students to the Unix environment."
We have been given a MANUAL to practice the problems and here I'll commit the programs as I successfully compile and get the desired output.
This repository is under progress.
Chapter 01 Practice Problems.
- 1. My First C Programme.
- 2. Evaluating trigonometric function sin(x).
- 3.1. Tabulates values of sin(x) using for loop.
- 3.2. Tabulates values of sin(x) using all the three loops.
- 4.1 Evaluating a function having one variable.
- 4.2 Evaluating a function having two variable.
- 5. Evaluating a function and storing the results.
- 6. To cheack whether a given number is a Palindrome number.
- 7. To cheack whether a given year is a leap year.
- 8.1. To find the HCF or GCD of two numbers using the defination.
- 8.2. To find the HCF or GCD of two numbers using the recursion.
- 9.1. Program to generate prime numbers upto n.
- 9.2. Program to generate prime numbers in given range.
Chapter 02 Practice Problems.
- 1.1. Plot of trigonometric function sin(x).
- 1.2. Plot of Example 1.4 function
- 2.1. Plot from datasheet "sq-cube.txt".
- 2.2. Plot of GM counter counting Statics "gmcounter.txt".
- 3.1. Saving the plot in eps filetype.
- 3.4. Saving the plot in png filetype.
- 4.1. Generating the datasheet for given step function.
- 4.2. Plotting the datasheet "periodic.txt" of square wave.
Chapter 03 Practice Problems.
Chapter 04 Practice Problems.
Chapter 05 Practice Problems.
Chapter 06 Practice Problems.
Chapter 07 Practice Problems.
Chapter 01 Excercise Problems.
- 1. Table of the trigonometric functions sin(x), cos(x) and tan(x).
- 2. Make a table of the function f(x,y).
- 3. Program to find Pythagorean numbers less than 100.
- 4. Program to find Harshad numbers between 50 and 70 both inclusive.
- 5.1. Program to generate Fibonacci numbers till 200.
- 5.2. Program to generate Fibonacci numbers till any integer.
- 6. Program to calculate the factorial of a given integer.
- 7. Program which calculates nCr and nPr for given values of n and r.
- 8. Program to determine the roots of a quadratic equation.
Chapter 02 Excercise Problems.
Chapter 03 Excercise Problems.
Chapter 04 Excercise Problems.
Chapter 05 Excercise Problems.
Chapter 06 Excercise Problems.
Chapter 07 Excercise Problems.
Chapters | Examples | Excercise |
---|---|---|
01 | ✔️ | ✔️ |
02 | ✔️ | ✔️ |
03 | ✔️ | ✔️ |
04 | ✔️ | ✔️ |
05 | ✔️ | ✔️ |
06 | ✔️ | |
07 | ✔️ | ✔️ |
It's better to write a gnuplot script with extension filename.p
, rather than writing the commands on gnuplot terminal. This way we can save our gnuplot codes for future needs.
If you've saved a gnuplot script named lissajous.p
in the current working directory:
For Linux user: gnuplot ./lissajous.p
For Windows user: load "lissajous.p"
Note: If we use load "lissajous.p"
in gnuplot terminal, it will work both in linux and windows.
All the linux distributers have git installed in their system so they simply paste the following code to get a local copy in your system.
git clone https://github.com/singhnir/DU-MSc-Lab-C-Prog.git
Normally no windows has git preinstalled so previous command doesn't work on it but again you can download a zip copy of the codes clicking here.
- Text Editor (Atom/Sublime/emacs...) - vim.tiny is aliased as vi in lab boxes
- GCC Compiler
- Gnuplot
If you've any doubt or suggestions regarding the project, please feel free to reach out by filing an issue here on github or you can simply email me at [email protected]. You can also drop a message to my Telegram account.