# JavaScript Programming

## JavaScript > Code Examples

### An if..else if...else statement

Find the First Occurrence of a Character in -
C program to 'input any string' from user and find the 'first occurrence' of a given character in the string. Input string from user and store it in a variable say "str". Run a loop from start

Program to Implement Ternary Seach Tree -
Program demonstrates the implementation of Ternary Seach Tree. Create a new ternary search tree node. And insert a new word in a Ternary Search Tree. Search a given word in

Count Zeros and Ones in a Binary Number -
Program input a number from user and count total number of ones (1s) and zeros (0s) in the given number using bitwise operator. How to count zeros and ones in binary number using

Check a Given Number is Perfect Number -
This C program code checks whether a given number is perfect number. Perfect number is a number which is equal to sum of its divisor. For eg,divisors of 6 are 1,2 and 3. The sum of

Alternate Nodes in linked list by Recursion -
Print the alternate nodes in a linked list using recursion. Program, using recursion, displays the alternate nodes in a Linked List. A linked list is an "ordered set" of data elements, each

C Decimal to Binary, Octal HEX Converting -
C programming converting example. Decimal number to Binary number, Octal number and HEX number converter. Enter any number to be converted. The Number has to be in the...

Removing All Characters Except Alphabets -
This program takes a string from the user and stored in the Variable line. The, Within the for loop, each character in the string is checked if it is an alphabet or not. If any character inside

Find Armstrong Numbers between 1 to N -
The Armstrong Number is a n-digit number that is equal to the sum of nth power of its digits. 407 = 4^3 + 0^3 + 7^3 = 407 is. Input upper limit to print Armstrong number from