19 August, 2012

Display prime numbers

The program shows how to display prime numbers. Here two for loops are used. 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, 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2 and 3 in addition to 1 and 6.Read More

27 July, 2012

Checking a number palindrome or not

The program shows how to check a number palindrome or not. Palindrome means a number if read from right to left or left to right will be same. Foe example 454 number value will be same if read from right to left or left to right. 675 is not a palindrome.The program shows how to check a number palindrome or not without using string functionRead More

27 July, 2012

Palindrome of a string

The below program shows a string is palindrome or not. This is done using string functions. string copy and string reverse functions are used to check a word palindrome or not. mom is a palindrome. car is not a palindrome. Here the entered string is copied into another variable and reverse of this string is compared with original string, to get a palindrome Read More

27 July, 2012

Display fibonacci series

The program shows how to display fibonacci series. fibonacci series is nothing but, a digit is sum of before two digits. 0 1 1 2 3 5 8... as shown in this series a digit is addition of previous two digits.The program shows how to display fibonacci series. fibonacci series is nothing but, a digit is sum of before two digits. 0 1 1 2 3 5 8... Read More

27 July, 2012

Greatest of three digits

The program shows the greatest number among three numbers. Here three different numbers are entered by user and by using if else conditions the greatest number of those three numbers is displayed as output. The program shows the greatest number among three numbers. Here three different numbers are entered by user and by using if else conditions Read More

27 July, 2012

Displaying number series

1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 The program shows the displaying of above series. The program shows the displaying of above series. The program shows the displaying of above series. The program shows the displaying of above series. The program shows the displaying of above series. The program shows the displaying of above series.Read More

27 July, 2012

Check a number odd or even without using modulus operator

Check a number odd or even without using bit and modulus operator program shows how to check a number odd or even without using a % operator. Here in the for loop % operator is not used, required number is compared with all even numbers, if it is a even number shows output as even number and if it is odd number shows output as odd number.Read More

27 July, 2012

Sum of digits in a number

The program shows how to calculate sum of digits in a number. For example take the number as 345 then sum of digits is 12.The program shows how to calculate sum of digits in a number. For example take the number as 345 then sum of digits is 12.The program shows how to calculate sum of digits in a number. For example take the number as 345 then sum of digits is 12.Read More