Latest Articles
-
Linear Search: C
In this video tutorial we shall see how we can search for a number in an array in linear fashion. First ask the user to enter the number to be searched. Store it inside a variable called key. Now start comparing key value with a[i] using a for loop. If the key is found in [...]
Apr.02, 2012 | Continue reading
-
Find First and Second Biggest In An Array, Without Sorting It: C
We assume that a[0] has first biggest and a[1] has the second biggest value. Now check if this assumption is correct, if not, swap the values. if( sbig > fbig ) { temp = sbig; sbig = fbig; fbig = temp; } Now since we have already checked with a[0] and a[1], we start [...]
Apr.02, 2012 | Continue reading
-
Find Biggest In An Array, Without Sorting It: C
First we have to assume that a[0] is biggest. Now store the value of a[0] inside a variable called big. Now compare value of big with other values in the array. If big is less than any other value, then store the bigger value inside variable big. Video Tutorial: Biggest In An Array, Without Sorting [...]
Mar.30, 2012 | Continue reading
-
Bubble Sort: C
In this video tutorial we illustrate the bubble sort algorithm and also see how to write it in C programming, for 5 elements as well as to N elements. In bubble sort, a[0] is compared with a[1]. a[1] with a[2], a[2] with a[3] .. so on if a[0] is greater than a[1], the values are [...]
Mar.30, 2012 | Continue reading
-
Selection Sort of N numbers: C
Selection sort is a sorting technique which is inefficient on large list of elements. Its simple and easy to understand. In selection sort, first we select one element and compare it with the rest of the elements. If the compared element is smaller than the selected element, then those numbers are sorted. This approach is [...]
Mar.28, 2012 | Continue reading
-
Find the Factorial of a Number: C
This video tutorial illustrates finding factorial of a given number using C programming. In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. Ex: if user enters 5, then the factorial is 1 * 2 * 3 * 4 * [...]
Mar.21, 2012 | Continue reading
-
Find Sum of Digits In A Given Number: C
Video Tutorial to illustrate, C Program to find sum of digits in the given/user entered integer number. In this program we assign variable sum = 0 to avoid garbage values in sum before the calculation, which would result in wrong output. We store the user entered value in num. 1 2 3 4 5 6 [...]
Mar.15, 2012 | Continue reading
-
Find Given Number Is Prime or Not: C
A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example, 7 is prime, as only 1 and 7 divide it, whereas 10 is [...]
Mar.13, 2012 | Continue reading
-
Biggest of 2 Numbers Using Function: C++
Find the biggest of two numbers using function and ternary operator. Basics of functions: A function is a sub program to perform a specific task. OR a group of instructions to perform specific task. Along with main() it is possible to define our own functions by following these steps: 1. Function prototype or Function declaration. [...]
Feb.08, 2012 | Continue reading
-
(Basic) Find Sum Using Dynamic Memory Allocation: C++
This video tutorial illustrates basics of Dynamic memory allocation in C++. It shows the use of new and delete operator for allocating and deallocating the memory dynamically. Find the sum of entered elements using dynamic memory allocation in c++. In cpp, dynamic memory management can be done using the operators new and delete. Operator new [...]
Feb.07, 2012 | Continue reading
-
Reverse Given Number And Check For Palindrome: C++
Cpp program to read a number, reverse the given number and check whether it is palindrome or not. Full Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 #include< iostream .h> #include< conio [...]
Feb.03, 2012 | Continue reading
-
Array Basics in C++ : Find Sum
Video tutorial to show the basic use of arrays: Initialization, Declaration, Getting values from the users, finding sum of all the array elements etc. Array is a collection of homogeneous data items. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [...]
Jan.26, 2012 | Continue reading
-
Find the Factorial of a Number: C++
Video tutorial to find the factorial of a number: if the user enters 3, then the factorial is 1 * 2 * 3 i.e., factorial = 6 This logic must be handled with a c++ program. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [...]
Jan.25, 2012 | Continue reading

