Algorithms and Flowcharts To Solve Problems
Algorithms and Flowcharts To Solve Problems
Examples:
Step1: Start
Step2: Initialize i=1 and sum=0
Step3: Read n
Step4: Repeat the i<=n
sum=sum+i
i=i+1
Step5: Print sum
Step6: Stop
Step1: Start
Step2: Define function ‘d_to_b()’
having parameter Named ‘num’
Step3: in the function Check for num>1
Step4: call the function and pass floor division
of the number ‘num’ as an argument
d_to_b(num//2)
Step5: Now Print num%2
#OutSide function
Step6: Read a number n
Step7: call function and pass the value of n
Step8: Stop
Step 1: Start
Step 2: Read value of p, r, t
Step 3: Calculate Interest=(p * r * t)/100
Step 4: Print Interest
Step 5: Stop
Reversing Digits Of An
Integer
Step1: Start
Step1: Start
Step2: Read Two Number (num1 and num2)
Step3: Assign these number to a and b
(a=num1 and b=num2)
Step4: Repeat this Step until num2!=0
temp=num2
num2=num1%num2
num1=temp
Step5: Assign Value of num1 to variable
named gcd
Step6: Display Result
Step7: Stop
Factorial Computation
Step1: Start
Step2: Declare Variable n ,fact and i
Step3: initialize variable(fact=1 and i=1)
Step4: Read the value of N
© Copyright All Rights Reserved. New ideas yt & http://www.sabdss.blogspot.com
Youtube channel : New Ideas yt को Subscribe जरुर करे By Satyam Sahu
Step5: Repeat these step until i==n
fact=fact*1
i=i+1
Step6: Display Fact
Step7: Stop
Step1: Start
Step2: Declare variable n,i,flag
Step3: initialize variable
Flag=1,i=2
Step4: read a number n
Step5: Repeat the steps until i<(n/2)
If remainder of n/i equals 0
Flag=0, got to step 6
i=i+1
Step6: if flag==0 Display n is not
Prime
Step7: else Display n is prime
Step8: Stop
Fibonacci Sequence
Step1: Start
Step2: take a number (x) in radians
Step3: take the value of n where n is a
number upto which we want to print
the sum of series
Step4: for first term
Sum=x, P=1, num=x, power=1
Step5: for next term
num=num*(-x2), power=power+2
p=p*(power-1)*power, next=num/p
Step6: The sum=sum+next
Step7: repeat the step 4 ,5 and 6 n-1 times
Step8: dislplay the value of sum
Step9: Stop
Step1: Start
© Copyright All Rights Reserved. New ideas yt & http://www.sabdss.blogspot.com
Youtube channel : New Ideas yt को Subscribe जरुर करे By Satyam Sahu
Step2: initialize a empty list lst=[]
Step3: read how many number user enter in list
Step4: read each element(num) using a for loop
Step5: in the for loop append each number to
the list lst.append(num)
Step6: Display Largest element in array using
predefine function max(lst)
Step7: Stop
Disclaimer: