In this example, we enter a word and check whether it is palindrome or not.
We check by reversing the given word and storing it in another variable and then
comparing both string.
In this example, we enter a word and check whether it is palindrome or not.
We check by reversing the given word and storing it in another variable and then
comparing both string.
In this example we find number of vowels present in a word or a sentence.
We declare a string vowel, in which all vowels are stored.
The program below has a break statement which affects the innermost loop in which it is located.
The program below takes input from the user and displays the month according to the inputted number by the user.
More complicated arithmetic expressions can be written quite easily. The program below shows one example of combining the various operators in a more interesting calculation.
Prime number is a number which is divisible by one or by itself only.
In this example we check for any factors of number that are present between number and one.
This example demonstrates a series where the difference of each term relative to the previous term is the same (i.e. discrete linear function), this program uses long as data type, in a SERIES.