 # Php Programming Code Examples

## Php > Algorithms Code Examples

Find Sum of Natural Numbers While Loop - The "Positive Numbers" 1, 2, 3... are known as natural numbers. The C program codes below takes a positive integer ( let say n ) as an input from the user and calculates the sum up to n.

Program to Extract Grams from Textdata - Print only the 'raw' words. Read input from 'FILE', default is stdin. Start reading lines from file pointer, add all entrys to 'strarray'. Print the array of strings, jumping back each

C Code Find LCM Least Common Multiple - C Program to Find LCM In C language. L.C.M. or Least Common Multiple of 2 values, is the smallest positive value which the multiple of both values. For example multiples of 3 and 4

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

C++ Language Codes Print Pascal Triangle - To print "Pascal Triangle" in C++, you have to enter the Number of Line. So to Print "Pascal Triangle", you have to use three For Loops as shown here in the C++ Programming samples

C++ Program to Perform Greedy Coloring - Give all its neighbouring colours a vertex, but before that keep a check on used colours and unused colours. 'Only assign', unused colours to the upcoming vertex. The problem takes a

C++ Shutdown & Restart Your Computer - C++ sample made for both i.e., to shutdown your computer or to 'restart your computer', first it will ask to the user want to shutdown computer or want to restart computer. Then

C++ Program Codes Print Prime Numbers - For example, to print prime number between '3 to 29', here 3 is the starting number and 29 is the ending number, enter the starting and ending number to find and print all the prime