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
In questa pagina del sito puoi guardare il video online How algorithms help us to write better code. della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Logic Class for Geeks 20 settembre 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 27 volte e gli è piaciuto 3 spettatori. Buona visione!