C program to swap adjacent elements of an one-dimensional array

In this tutorial, we will learn how to swap adjacent element of an integer array using C programming language. For example, if the array is [1,2,3,4,5,6], after swapping it will become [2,1,4,3,6,5]. The user will enter the elements of the array.Our program will swap the adjacent elements and then print out the final array. Let's take a look at the program first :.

Read

Insertion sort implementation in C : Sorting an integer array

Insertion sort is one of the simplest sorting algorithm. It iterates through the items one at a time and keeps building the final sorted array. For example, for an array of 5 elements, it first sorts the first two elements , then first three elements , next first four elements and so on.

Read

C program tutorial to swap two strings

In this tutorial, we will learn how to swap two strings using C programming language. The user will enter both strings and our program will swap these strings and print out the results. Let's take a look at the program first :.

Read

(iOS) Adding Swipe gesture to a view in Swift 4

In this tutorial, we will learn how to add swipe gesture in iOS applications using swift 4. The swipe gesture can be added to any view. For example, you have one custom notification over your application and you want to remove it if the user swipe from left to right. In that case, we need to add one gesture recognizer on that view. We will add one custom ’view’ and show you how to add all top, bottom, left and right swipe gesture recognizer for that view. Let’s have a look :.

Read

Java program to check if all digits of a number are in increasing order

3 different ways in Java to check if the digits of a number are in increasing order or ascending order. We will learn how to use a while loop, a different method and by converting the number to a String.

Read

Java program to check if a number is Pronic or Heteromecic

A number is called a Pronic number or Heteromecic number if it is equal to the product of two consecutive numbers. For example, 9 * 10 = 90, so 90 is a Pronic number.Our program will take the input from the user and check if it is Pronic.Let's take a look at the program first :.

Read

Java Program to create a temporary file in different locations

In this tutorial, we will learn how to create a temporary file in Java. We can create a temp file either in the default temporary file location folder or in a specific folder. To handle this, we have two different static methods in the File class. Let's take a look into them first :.

Read

Java program to extract all numbers from a string

In this tutorial, we will learn how to extract numbers from a String using Java programming language. The user will enter the string and our program will extract all numbers from the string and print out the result. Let's take a look at the program first :.

Read

Java program to print the boundary elements of a matrix

In this tutorial, we will learn how to print the boundary elements of a matrix using Java. For example, for the below matrix :.

Read

Java program to print an identity matrix

In this tutorial, we will learn how to print one identity matrix using Java programming language. Identity matrix is a matrix whose diagonal elements are 1. Diagonal elements starting from top left to right end should be 1 and other elements are 0 of that matrix.

Read