Computer Programming C Laboratory: Algorithms, Flowcharts and Pseudocodes

Write a program to find the roots of the quadratic equation (Algorithms, Flowcharts and Pseudocodes)

Algorithms, Flowcharts and Pseudocodes: Write a program to find the roots of the quadratic equation

Write a program to find the roots of the quadratic equation.


Algorithm

Step 1: Start

Step 2: Enter the value of a,b,c

Step 3: Find the value of 'D' of using the formula

D ← b * b ‒ 4 * a * c.

Step 4: If D is greater than or equal to zero then find the two roots are root 1 ← (‒b + sqrt(d)) / (2 * a)

root 2 ← (‒b‒sqrt(d)) / (2 * a)

Step 5: Print the two roots, root1, root2

Step 6: If D.is not greater than or equal to zero, then print the roots are imaginary

Step 7: Stop


Flow chart



Pseudocode

Set initial zero to rootl, root2

READ the value of a,b,c

Find discriminant

D = b * b ‒ 4 * a * c

IF D > = 0 THEN

calculate root1 = (‒b + sqrt(D)) / (2 * a)

               root2 = (‒b ‒ sqrt(D)) / (2 * a)

ELSE

     Roots are imaginary

ENDIF

WRITE root1, root2

 

Computer Programming C Laboratory: Algorithms, Flowcharts and Pseudocodes : Tag: : - Write a program to find the roots of the quadratic equation (Algorithms, Flowcharts and Pseudocodes)


Computer Programming C Laboratory: Algorithms, Flowcharts and Pseudocodes



Under Subject


Computer Programming C Laboratory

CS25C01 1st Semester EEE, ECE, CSE, CSE(CY), AIDS, IT practical Laboratory Manual | 2025 Regulation | 1st Semester Laboratory 2025 Regulation



Related Subjects


English Essentials I

EN25C01 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


தமிழர் மரபு - Heritage of Tamils

UC25H01 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Applied Calculus

MA25C01 Maths 1 M1 - 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Applied Physics I

PH25C01 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Applied Chemistry I

CY25C01 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Makerspace

ME25C04 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Computer Programming C

CS25C01 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Computer Programming Python

CS25C02 1st Semester | 2025 Regulation | 1st Semester 2025 Regulation


Fundamentals of Electrical and Electronics Engineering

EE25C03 1st Semester EEE Depart | 2025 Regulation | 1st Semester 2025 Regulation


Introduction to Mechanical Engineering

ME25C03 1st Semester Mechanical Dept | 2025 Regulation | 1st Semester 2025 Regulation


Introduction to Civil Engineering

CE25C01 1st Semester Civil, Agri Departments | 2025 Regulation | 1st Semester 2025 Regulation


Essentials of Computing

CS25C03 1st Semester - AIDS, CSE, CSE(CY), IT Department | 2025 Regulation | 1st Semester 2025 Regulation


Applied Physics I Laboratory

PH25C01 1st Semester practical Laboratory Manual | 2025 Regulation | 1st Semester Laboratory 2025 Regulation


Applied Chemistry I Laboratory

CY25C01 1st Semester practical Laboratory Manual | 2025 Regulation | 1st Semester Laboratory 2025 Regulation


Computer Programming C Laboratory

CS25C01 1st Semester EEE, ECE, CSE, CSE(CY), AIDS, IT practical Laboratory Manual | 2025 Regulation | 1st Semester Laboratory 2025 Regulation


Computer Programming Python Laboratory

CS25C02 1st Semester practical Laboratory Manual | 2025 Regulation | 1st Semester Laboratory 2025 Regulation


Engineering Drawing

ME25C01 EEE, Mech, Agri, EEE Depts | 2025 Regulation | 2nd Semester 2025 Regulation


Basic Electronics and Electrical Engineering

EE25C04 1st Semester ECE Dept | 2025 Regulation | 1st Semester 2025 Regulation


Essentials of Computing - Laboratory

CS25C03 1st Semester AIDS, CSE, CSE(CY), IT Depts | practical Laboratory Manual | 2025 Regulation | 1st Semester 2025 Regulation