Subject: Data Structures & Algorithms: P.C.C.O.E.PUNE-44
Subject: Data Structures & Algorithms: P.C.C.O.E.PUNE-44
Aim of Experiment:
Write C Program for finding the following:
E1) Checking Prime number
E2) Roots of the Quadratic equation
Objectives:
Able to understand the basic concept of a writing the C programs.
SE E & TC
Dept. of E & TC
(SEM-I, 2014-15)
P.C.C.O.E.PUNE-44.
Algorithm:
Step 1: Start
Step 2: Read number N
Step 3: Check if N is less than equal to 1 then N is not prime number then stop
Step 4: Check if N is equal to 2 then N is prime then stop
Step 5: Set count Index I = 2
Step 6: Divide N by I and check Remainder,
if Remainder R = 0 then N is not prime then stop.
Step 7: Increment count index until I <= N
Step 8: Stop
Algorithm:
Step 1: Start
Step 2: Input the Coefficients of quadratic equation
SE E & TC
Dept. of E & TC
(SEM-I, 2014-15)
P.C.C.O.E.PUNE-44.
Example:
The quadratic equations 2X+ 5X + 3
- (b-4ac) = (25-4*2*3) = 1
References:
1. C programming by Balguruswami.
2. Let us C Kanetkar.
3. Fundamentals of data structures sartaj sahani.
Conclusion:
SE E & TC
Dept. of E & TC
(SEM-I, 2014-15)