Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes
CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes

Programming Code Examples with Java C C# C++ Html VBasic Php

C coding to Accessing 2-D Array Elements
Program code to access every 2-D Array we requires 2 subscript variables. y - Refers the Row number. x - Refers Column number. a[1][0] refers element belonging to first row
C Checking the Character is Alphabet Digit
C Programming input a character and Check whether given character is alphabet, digit or special character using if else. A character is alphabet if it in between a-z or A-Z. Character
Check Even or Odd using Bitwise Operator
C Language program code sample input any number and check whether the given number is even or odd using bitwise operator. How to check whether a number is even or odd using
Calculates Area & Circumference of Circle
To calculate area and circumference we must know the radius of circle. C program code will prompt user to enter the radius and based on the input it would calculate the values. Make
Code Converts Decimal to Binary Number
C Program Code input Decimal number from user and convert to binary number system. Decimal number system is a base 10 number system. Decimal number system uses only 10
C Program to Add two Complex Numbers
This C Program adds two complex numbers. A Complex Number is a number that can be put in the form a + bi, where a and b are real numbers & i is called imaginary unit, where...
Finds Greater Number of Entered Number
Program 'takes a number' as input and finds a Greater number of the entered number using same digits. Take a number as input. Reverse the number and store it in the array. Using for
Finds Factorial of Number using Recursion
Declare recursive function to find factorial of a number. First let us give a meaningful name to our function, say fact(). Factorial Function accepts an integer input whose factorial is to
Check Prime, Armstrong, Perfect Number
C First give a meaningful name to our prime checking function say isPrime() function will check a number for prime. Since our function checks a number for prime condition. Hence
C Program Inputs two Strings & Compares
Lets take 2 Strings as input and store them in the arrays string1[] and string2[] respectively. "Count the Number" of characters in both the arrays and store the result in the variables co1
Maximum Minimum Elements in the Array
How to find maximum and minimum element in an array using recursion in C programming. Recursion works on the concept of divide and conquer. We break the problem in its smallest
Prime Numbers in a Range with Functions
Declare function to find all prime numbers in given range. First give a meaningful name to our function. Say printPrimes() function will print all prime numbers in a range. Declare...
Checks Character is Uppercase Lowercase
C program code to input character from user and check whether character is Uppercase or Lowercase alphabet using If Else Statement. Input a character from user. Store it in some
Input Number & Check it is Palindrome or
C program input number and check number is Palindrome or not using Loop. Palindrome number is such number which when reversed is equal to the original number. 121, 12321,...
If Else Check Given Integer is Odd or Even
The if...else statement executes some code if the test expression is true (nonzero) & some other code if the test expression is false (0). If test expression is true, codes inside the body
Convert a Given Number of Days in Terms
C language program take the number of days as input. For the number of years, divide the input by 365 and obtain its quotient. For the number of weeks, divide the input by 365 and
C If a given Integer is Positive or Negative
Take the integer which you want to check as input and store it in a variable number. Using if, else statements check whether the integer is Greater or Lesser than zero. If it is greater...
Check Vowel or Consonant use switch case
English Alphabets a, e, i, o, u both lowercase & uppercase are known as vowels. Alphabets other than Vowels are known as Consonants. Input an alphabet from user. Store it in some
C Find Sum of Natural numbers in a range
Give a meaningful name to the function, say sumOfNaturalNumbers(). The function must accept two inputs i.e. the lower & upper limit to find sum. Pass two integer parameters to
Count total Duplicate Elements in an array
Code read elements in an array from user and count total number of duplicate elements in array. C program code to find all duplicate elements in an unsorted array. How to list all
Create an Array of Chars in C++ Language
String is a "sequence of characters". char data type is used to represent one single character in C++. So if you want to use a String in your program then you can use an "array of chars".
Checks a Character is Capital Letter or Not
Takes input a Character and Check it whether a 'character' is capital letter, small letter, Digit or Special character. 'All characters' like small or capital letters, digits and special characters
C++ Language Displaying Fibonacci Series
The Fibonacci sequence is a series where the next term is the "sum of pervious two terms". The first two terms of the Fibonacci sequence is 0 followed by 1. Fibonacci Numbers: 0, 1, 1,
C++ Language & Concatenate Two Strings
Combined two strings means add both string with each other, perform this operation using 'library function' or without library function. If first string is 'john' and second string is porter
Checks Whether a Number is Prime or Not
A 'positive integer' which is only divisible by 1 and itself is known as prime number. So 13 is a prime number because it is only divisible by 1 and 13 but, 15 is not prime number because
Matrix Multiplications Mutiply 2 Matrices
Column number of first matrix must be same as the row number of second matrix. Initialize matrix. Print values of the passed matrix and mutiply two matrices and return the resultant
C++ Sample Calculate Power of a Number
Program takes two numbers (a 'base number' and an 'exponent') and Calculates the Power. The technique works only if the exponent is a positive integer. If you need to find the power
C++ Simple Calculator Code for Beginners
Write a simple C++ program which have four different functions for "basic operations" like addition, subtraction, division, multiplication. It should be menu based asking user to enter
C++ Additions Subtractions Multiplication
Perform addition, subtraction, multiplication and division of any two numbers in 'C++', you have to enter the 'two number' and enter the operator to perform the particular operation
A Calculator Add Subtract Multiply Divide
Takes an "arithmetic operator" (+, -, *, /) and two operands from an user and performs the operation on those two operands depending upon the operator entered by user. Program
Program to Calculate Average of Numbers
Takes n number of element from user (where, n is specified by user), stores data in an array and calculates the average of those numbers, program calculates the average if the number
C++ Language Break Continue Statement
We can use "break" statement inside loops to terminate a 'loop & exit' it. In above example loop execution 'continues' until either n>=20 or entered score is negative. This statement
C++ Prim's Algorithm Finds the Minimum
Find the minimum spanning tree of the given graph using Prims algorihtm. This algorithm is a "greedy algorithm" that finds a minimum spanning tree for a "Connected Undirected"
C++ Language Accessing Array Elements
"Array index" starts with 0, which means the first array element is at index 0, second is at index 1 and so on. We use this information to display the array elements. See the C++ code
Simple Programs Area Of Square Formula
The second power was described in terms of the area of a square, as in the above formula. It led to the use of the term square to mean raising to the "second power". Thus the area
C++ Code Find ASCII Value of a Character
Full form of Ascii is American Standard Code for Information Interchange. It is a character "Encoding Scheme". Originally based on the English alphabet, every character or number
Calculating Difference Between two Time
Ask to enter two time periods and these two periods are stored in structure variables t1 t2 respectively. The computeTimeDifference() Function calculates the Difference Between
C++ Language List of Reserved Keywords
Any "Programming Language" has a "list" of keywords. C++ Keywords are list of reserved words for this Programming Language. Each keyword has a special meaning and it can not
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
Increment Operator Decrement Operator
Basic "arithmetic operators" are +, -, *, /, %. "Increment operator" is ++ and "decrement operator" is --. These operators can be used as before the variable (prefix) and after the
A link to send an Email
A prepopulated text field with a maximum length
A tag visited hyperlink
Absolute position to the bottom
Add background image, margin, padding DD
Add no repeat icon to title text
Adding an XHTML DOCTYPE declaration
Anchor background-color
Anchor background-repeat no-repeat
Anchor font-family
Byte to Binary Conversion
Applet that demonstrates a Java2D GeneralPath
Fade an Image
Drawing Shapes in Java 2D
Program to check the input characcter for uppercase, lowercase, no. of digits
Display an Image in Canvas
Comparing dates of two files
Fibonacci numbers (Right side)
Creating a Shared File Lock on a File
Sending a file from Applet to Servlet
A Basic HTML Page
A Browser History Count
A Dynamic Welcome Message
A Form for Entering a URL
A function with arguments, that returns a value
A Simple HTML Document
'abs()' Math Function
Absolute position layout
Access Image URL to TextBox
Access window properties