 # Visual Basic Programming Code Examples

## Visual Basic > Code Snippets Code Examples

### Get windows system directory

Program Code Find Factorial of a Number - Program to input a number and calculate its factorial using for loop. Factorial of a number n is product of all positive integers less than or equal to n. It is denoted as n!. ex. 5! = 120

Finds HCF of given Number use Recursion - Program to find HCF of a given number using recursion. Programming code using recursion finds the HCF of 2 entered integers. The 'HCF' stands for Highest Common Factor. Enter the

C Matrix of Order M x N and Interchange - C language program code to accept a matrix of order M x N and store its elements and interchange the main diagonal elements of the matrix with that of secondary diagonal

C Program Sample Bubble Sort Algorithm - Implementing bubble sort. Bubble sort is also known as sinking sort. This sorting algorithm compares each pair of adjacent items. Swaps them if they are in the Wrong Order, and this

Perimeter of a Circle Rectangle & Triangle - This C Program calculates the perimeter of a circle, rectangle and triangle. This program is used to find the perimeter of circle, rectangle and triangle. Perimeter of rectangle: 2 *(x+y)

Park-Miller Random Numbers Generation - C++ Program to generate 'random' numbers using Park-Miller algorithm. general formula of a random number generator (RNG) of this type is: 'X_{k+1} = g X(k) mod n'. To generate

Prints the Sum of all Odd Numbers in C++ - The digit sum of a given integer is the sum of all its digits (digit sum of '84001' is calculated as 8+4+0+0+1 = 13). Odd number is an integer which is not a multiple of two. If it is "divided"

Learn Bitwise Operators in C++ Language - in C++, "bitwise operators" are similar to the Logic operators, but they perform the same logical operations on bits. All data in memory is represented in the "binary form". Variables