Posts

Showing posts with the label square of any number

Selection sort (code & Algorithm)

Image
I n this blog you have to know all about the Selection sort, Step by step how to work Selection sort Algorithm and also you have to know how to write code in an easy way for selection sort. In Selection sort we are arranging unordered number in a correct order, Examples: This is unordered number (9,6,4,7,3,2,4,5,) but by using selection sort we can arrange in ascending order (2,3,4,5,6,7,9) this is our selection sort, to arrange in an order of given unorder number.       A lgorithm: f C ode for Selection sort: #include <stdio.h> // Function to perform selection sort on an array void selectionSort ( int arr [] , int n ) {     int i , j , min_idx , temp ;     // One by one move boundary of unsorted subarray     for ( i = 0 ; i < n - 1 ; i ++ ) {         // Find the minimum element in unsorted array         min_idx = i ;         for ( j = i + 1 ; j < n...

C Program to Write Square of any Number - Aman The Programmer

Image
Calculate Square of any Number: This Program is allowed to user, enter the number and get Square of that number. This program makes easy to calculate Square of any Number ......  https://youtu.be/9XJq-RYcYYo?si=XB6UVDBnHKjUsQh3 #include <stdio.h> int main () {     int number, square;     printf ( "enter the integer:" );     scanf ( " %d " , & number);     square = number * number;     printf ( "the square of %d is %d " , number , square);     return 0 ; } Output: Click here to get more Source Code:   https://amantheprogrammer.blogspot.com/2024/10/html-code-for-beginners.html https://youtu.be/iGJtLh0lsZo https://youtube.com/@amantheprogrammer?si=O8SGDjNhKTD5Xs-N