How algorithms help us to write better code.

Publicado em: 20 Setembro 2025
no canal de: 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


Nesta página do site você pode assistir ao vídeo on-line How algorithms help us to write better code. duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Logic Class for Geeks 20 Setembro 2025, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 27 vezes e gostou 3 espectadores. Boa visualização!