How algorithms help us to write better code.

Veröffentlicht am: 20 September 2025
auf dem Kanal: 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


Auf dieser Seite können Sie das Online-Video How algorithms help us to write better code. mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Logic Class for Geeks 20 September 2025 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 27 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!