How algorithms help us to write better code.

Published: 20 September 2025
on channel: Logic Class for Geeks
27
3

How algorithms help to write better code.
.
.

#Algorithm
#Algorithm is a step-by-step set of instructions to solve a problem
#Key Points in Algorithm
#1. Input: Takes atleast one input.
#2. Output: Produces atleast one output.
#3. Definiteness: Each step should be clear and unambiguous.
#4. Finiteness: Must terminate after a finite number of steps.
#5. Effectiveness: Each step should be completed in a finite amount of time.

#Pseudocode
'''
Program starts
Read Cost Price (CP)
Read Selling Price (SP)
If (SP great than CP) then
Profit = SP – CP
Print Profit
Else
Loss = CP – SP
Print Loss
Program ends
'''

#Code
cost_price=float(input("Enter the cost Price of your Item :"))
selling_price=float(input("Enter the Selling Price of your Item :"))
if (selling_price greater than cost_price):
profit = selling_price - cost_price
print("Profit :",profit)
else:
loss = cost_price - selling_price
print("Loss :",loss)

.
.

#coding #programming #
#programminglanguage #learncoding #basic #computerknowledge #firstcodingclass #python #c #helloworld #codingclass #logicclassforgeeks #algorithms #flowchart #interview #pythoninterview #cbsc
Coding | Program | programming | coding class | logicclassforgeeks | learn coding


On this page of the site you can watch the video online How algorithms help us to write better code. with a duration of hours minute second in good quality, which was uploaded by the user Logic Class for Geeks 20 September 2025, share the link with friends and acquaintances, this video has already been watched 27 times on youtube and it was liked by 3 viewers. Enjoy your viewing!