How To Ideas | How To Articles | How To Tutorials


List/Grid Programming languages Subscribe RSS feed of category Programming languages

How to enable/disable Bluetooth programmatically in Android

In this tutorial, I will show you a simple but very useful example to switch on/off the bluetooth of your Android phone programmatically. You can do this by either calling the system intent for the same or directly from your application. In this application, I will cover only the second part. The application will be having a TextView to show the current status of Bluetooth and a ToggleButton to toggle… Read more »

How to Perform Linear Search using C Language

Consider you have an array of 10 numbers and you want to find out position of a particular number. Linear Search can help you with that and it is one of the best criteria to search when you have un-ordered list of number. Linear Search is a method for finding a particular in an array or list, which consists of checking every element of that array, one at a time… Read more »

How to check whether a number is Armstrong Number in C

Armstrong Numbers are those numbers which are equal to the sum of its own digits each raised to the power of the number of digits in the number. Consider number 153, it has three digits, so length is 3. Now each digits raised to the power of the number of digits in the number :  13 = 1, 53 = 125, 33 = 27. Sum of these values : 1… Read more »

How to find Nth Perfect Number in C language

Perfect Numbers are those numbers which is equal to the sum of its proper positive divisors (excluding itself). Consider number 6, it has only four proper positive divisors 1, 2, 3 and 6. If we exclude 6, proper divisors left are 1, 2 and 3 and their sum is 6 which is equal to the number itself. So, 6 is a Perfect Number. You can learn more about Perfect Numbers… Read more »

How to find Nth Prime Number in C language

Prime numbers are the numbers greater than 1 which are divisible only by 1 and itself, like 3 is divisible by 1 and 3 only. So, if a natural number n is a Prime Number, then it is divisible by only 1 and n and not divisible by any number from the sequence 2, 3, 4, . . . . , (n – 1). You can find more information about… Read more »

How to find list of Prime Numbers in a given range in C

Prime numbers are the numbers greater than 1 which are divisible only by 1 and itself, like 3 is divisible by 1 and 3 only. So, if a natural number n is a Prime Number, then it is divisible by only 1 and n and not divisible by any number from the sequence 2, 3, 4, . . . . , (n – 1). You can find more information about… Read more »

How to find Prime Factors of a number in C language

In Number Theory, every Natural Number can be expressed as a multiple of Prime Numbers only and those Prime Numbers are called Prime Factors of that number. So, Prime Factors of a positive integer are the Prime Numbers which can divide the number perfectly that is no remainder will be left. More information about Prime Factors can be found on Wikipedia. In this example, I will show you a C… Read more »

How to find LCM using GCD- Euclid’s Method

Least Common Multiple (LCM) of two numbers is the smallest positive integer which is also a multiple of both the numbers. If any of the two numbers is 0, LCM of those two numbers will be 0. You can find more about LCM of two numbers on Wikipedia. In this tutorial, I will show you how can you find LCM of two numbers using Euclid’s Method i.e. by using GCD… Read more »

How to check whether a number is Perfect in C

Perfect Numbers are those numbers which are equal to the sum of its proper positive divisors (excluding itself). Consider number 6, it has only four proper positive divisors 1, 2, 3 and 6. If we exclude 6, proper divisors left are 1, 2 and 3 and their sum is 6 which is equal to the number itself. So, 6 is a Perfect Number. You can also say that Perfect Number… Read more »

How to find Greatest Common Divisor ( GCD ) using Euclid’s Method in C

Greatest Common Divisor ( GCD ) or Highest Common Factor ( HCF ) or Greatest Common Factor ( GCF ) of two numbers is the greatest positive integer that perfectly divides both the numbers. You can find more about GCD of two numbers on Wikipedia. In this tutorial, I will show you a very simple way to find GCD of two numbers using Euclid’s Method in C language. You can… Read more »



© 9791 How To Ideas. All rights reserved.
Proudly designed by Theme Junkie.