Skip to main content

Posts

Perfect Number

                    A Perfect number is a number that is equal to sum of its all positive divisors excluding the number itself.                         For  example 6 is a perfect number.      Sum of its divisor is equal to the number.                                   1+2+3=6                                               FLOWCHART          To see the working of Perfect Number Flowchart Click here to Watch on YouTube Learn to write a program in C to find whether a given number is perfect number or not. Click here to Watch on YouTube

Bubble Sort

               Bubble Sort is a sorting algorithm that works by comparing each pair of adjacent items and swapping them if they are in wrong order repeatedly till the list is sorted.               Bubble sort is also referred to as sinking sort or comparison sort . The algorithm is named for the way smaller or larger elements “bubble“ to the top of the list.              Bubble sort algorithm is the simplest algorithm for sorting but it is too slow and impractical for most problems. Bubble Sort Algorithm Step 1: Enter how many numbers(n) to sort. Step2: Enter all numbers and store it in array a[]. Step3: Make a key starting with second element of an array a[]. Step4: Now compare the [key-1] element of an array a[] with [key] element of an array a[]. Step5: For ascending order if the [key-1] element of an array a[] is greater than [key] element of an array ...

Armstrong Number

            An Armstrong number is an  n -digit number that is equal to the sum of the  n th  powers of its digits. For example 153 is an Armstrong Number in 3 digit number 1 3  +  5 3  +  3 3   =  153 1  +125+27  =153 1634 is an Armstrong Number in 4 digit number 1 4  + 6 4  + 3 4  + 4 4  =  1634 1+1296+81+256=1634 And so numbers from 0-9 all are Armstrong Numbers as  0 1 is 0 , 1 1   is 1,   2 1 is 2 , 3 1 is 3 and so on..   Armstrong Algorithm Step1: Read a number.  Step2:  Store all the digits of a number in an array digits[] Step3:  Count all the digits of a number and store in variable   length Step4:  Start a loop till  the length of a number Step5: Raise each digit to a power equal to the number of digits in the number. For ex, each digit of a thre...

Multiplication Tables

                        Learn the Multiplication Tables                                                                                 Learn how to write the Program in C to generate the Multiplication Table of any number. Click here to watch on YouTube Learn how to  make  the Multiplication Table App in          MIT App Inventor Click here to watch on YouTube Download the Multiplication Table Android App here Multiplication Table App

Reverse Fibonacci Sequence

Fibonacci sequence works well below zero too. Here is the sequence -8,5,-3,2,-1,1,0,1,1,2,3,5,8,13,… T he sequence below zero has the same numbers as the sequence above zero,  except they follow a +-+- ... pattern. To see the working of Reverse Fibonacci Sequence Flowchart,                                     Click here to watch on YouTube To write the program in C,                            Click here to Watch on YouTube

Factorial of a Number

       FACTORIAL   !   The factorial of a positive integer n , denoted by n! , is the product of all positive integers less than or equal to 1.     For example the factorial of 6 is 6! = 6*5*4*3*2*1 = 720 The value of 0! is 1 , according to the convention for an empty product. We can calculate a factorial of a number(n)  from the previous one i.e. by multiplying the number (n)  to a factorial of number(n-1) . n! = n * (n-1)! For example: 5! = 5*4*3*2*1 = 120 . So calculate the factorial of 6 by above rule. 6! = 6 * (6-1)! = 6 * 5!= 6 * 120 = 720 7! = 7 * (7-1)! = 7 * 6!= 7 * 720 = 5040 To see the working of flowchart,  Click here to watch on YouTube To write the program in C,  Click here to watch on YouTube To Create the Factorial App in MIT App Inventor  Click here to watch on YouTube Download the Factorial Android App here Factorial Android Ap...

Sum of Digits of a Number

Write an algorithm ,a program and  draw a flowchart  to calculate the  sum of digits of any number given by a user. Step1: Read a number (n) to calculate its sum of digits Step2: Divide the value of n by 10 and assign it to variable x Step3: Multiply the value of x by 10 and assign it to variable t Step4: Subtract the value of t by value of n and assign it to variable c Step5: Add the value of c & value of sum and assign it to variable sum Step6: Assign the value of x to variable n Step7: if x is not equal to zero then go back to step2 Step8: Display “the sum is “, value of variable sum Step9: Stop Flowchart To see the working of Algorithm an flowchart,  Click here to Watch on YouTube To write the program in C,  Click here to watch on YouTube To create the SumOfDigits App in MIT App Inventor,  Click here to Watch on YouTube Download the SumOfDigits Android App by clicking below-: ...