Binary Search in C

Binary search in C programming is to find an element’s position in a sorted Array. The following program for binary search finds the location of a searched element from the array. Binary search is applied to sorted elements. So if the array is not sorted, you must sort it using a sorting technique. You can … Read more

Magic Number in C

In this tutorial, we will write a program for Magic Number in C. Before that you may go through the following topics in C. A number is said to be a Magic Number if the sum of the digits of that number, when multiplied by the reverse number of the sum of its digits, is … Read more

Global Variable in C

Global variables in C are declared outside any functions and usually at the top of the program as shown below. They can be used in the program inside any block of code. Properties of a Global Variable: Global variables are defined outside a function, usually on top of the program. The lifetime of a Global … Read more

Local Variable in C

A variable that is declared within the body of the function or block is called a local variable. This variable is used only within that block or function where it was created, other classes cannot access it. And is destroyed after exiting the block. Properties of a Local Variable: A local variable is allocated on … Read more

Kruskal’s Algorithm in C

In this article, you will learn the implementation of Kruskal’s Algorithm in C programming and starting with Kruskal’s Algorithm. Kruskal’s Algorithm It is a greedy algorithm that is directly based on MST (Minimum Spanning Tree). Kruskal’s algorithm finds a minimum spanning tree for a connected weighted graph. It finds a subset of the edges that … Read more

Java Program to Write in a File Line by Line

In this tutorial, you will learn how to Write in a File Line by Line in java. To understand it better, you may want to check the following first: File in Java Java Program to Write in a File Line by Line Output: Done..Check javaCode.txt javaCode.txt Welcome to Simple2Code.Start the Tutorial