Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit I C Language Review Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010.

Similar presentations


Presentation on theme: "Unit I C Language Review Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010."— Presentation transcript:

1 Unit I C Language Review Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010

2 Contents 1.Algorithms, flowcharts 2.Data types in C 3.The C character set: Constants, Variables and keywords 4.Decision Control

3 Algorithm and Flowchart A sequential solution of any program that written in human language, called algorithm. Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem. Graphical representation of any program is called flowchart.

4 Symbols Used in flowchart

5 Algorithm 1.Start 2.Input Current ( I ) and resistance( R) 3.Calculate voltage V= I*R 4.Display the voltage, V 5.Stop

6 Start Calculate V= I * R Input I and R Print V Stop

7 Data Types in C Variable TypeKeywordByte reqdRangeFormat Character (signed) char1-128 to +127%c Integer ( Signed) int2-32768 to +32767%d Float ( signed)float4-3.4e30 to + 3.4e38%f Doubledouble8-1.7e308 to + 1.7e308%lf Long Integerlong4-2147483648 to 2147483647%ld Character ( unsigned) unsigned char10 to 255%c Integer ( unsigned) unsigned int20 to 65535%u Unsigned long integer Unsigned long40 to 4294967295%lu Long Doublelong double10-1.7e932 to +1.7e932%lf

8 Constants, Variables, Keyword Smallest individual unit value that does not change during the execution of a program e.G PI,”Ram”, “a” A variable is a name, given to a temporary memory location that has been used to store any value. e.g salary, a,b,A,B etc. Keywords are the words whose meaning has already been explained to the compiler. e.g if, else, break, switch,int,float, union etc

9 Decision control if statement if else statement Nested if statement switch case statement

10 if statement If (this condition (expression) is true ) { execute this statement; } Expression is true if x == y x is equal to y x !=y x is not equal to y x y x is greater than y x = y x is greater than or equal to y if (per < 40 ) { printf ( “fail” ) } if ( per >=40 && per <=50) { printf(“Pass class”); }

11 if else if(condition) { statements; } else { statements; } if ( remainder is zero) { printf(“Even number”); } else { printf(“Odd number”); }

12 Nested if

13 switch case switch(2) { case 1: statement 1; break; case 2: Statement 2; break; }

14 Unit II Program Development concepts Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010

15 contents The loop control structure Functions and pointers Arrays

16 Loop Control Structure Looping : – while loop – do while loop – for loop Loop Control – break -- exit from loop or switch. – continue -- skip 1 iteration of loop.

17 Unit III Numerical computational techniques 1 a. Solution of transcendental & polynomial equation. b. Solution of bisection method. c. Solution of Newton Raphson method. Ref. Book: S.S. Shashtry, “Introductory Methods of Numerical”, Tata McGraw Hill.

18 Unit IV Numerical computational techniques 2 a. Solution of secant method. b. Solution of linear equations using Gauss elimination method and Gauss-Jordan methods. c. Numerical integration and differentiation: trapezoidal rule Simpson's 1/3 and 3/8 rule.. Ref. Book: S.S. Sastry, “Introductory Methods of Numerical”, Tata McGraw Hill.

19 Unit V MATLAB a. Introduction, Basics of MATLAB b. Working with arrays of numbers c. Creating and printing simple plots d. Creating and executing a Script file, function file. e. Interactive computations: Matrices and vectors, Matrix and array operation. f. Graphics: Basic 2-D plots, 3-D plots. MATLAB Release Notes for Release 12, The Math Works, Inc., 2000.

20 Practical List 1. Bisection Method program. 2. Secant Method program. 3. Newton Raphson Method program. 4. Gauss Elimination Method Program. 5. Gauss seidal Method Program. 6. Simpson`s 1/3 rd and 3/8 th rule program. 7. Arithmetic operations on matrix using MATLAB. 8. Plot the simple, 2-D and 3-D plots using MATLAB. 9. Find the roots of polynomial equations using MATLAB. 10. Find eigenvalues and eigenvectors, LU factorization. Note: Lab file should consist of minimum Eight experiments.

21

22

23

24

25

26

27

28

29

30

31

32

33


Download ppt "Unit I C Language Review Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010."

Similar presentations


Ads by Google