Aug 22, 2017

Check given String for Palindrome

Program: Find given string is palindrome or not Palindrome: A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward, such as madam or racecar. So in this program we take input string from user and return the result whether...

Dec 5, 2016

Program: Print first 10 Perfect Number

Program: Find or Print first 10 Perfect Number Perfect number is a positive number which sum of all positive divisors excluding that number. For example: 6 is perfect number as divisor of 6 are 1, 2, 3. Sum of it divisor is 1 + 2 + 3 = 6. Simple way to do is find divisor of each element...

Dec 1, 2016

Program: Print first n Prime Number

Program: Print first n Prime Number We earlier done the program of how to check Prime Number, in that program we are checking whether the given number is prime or not. In this program we are taking input n and printing first n prime number. Prime number is a number which is greater than one...

Nov 30, 2016

Introduction to User Defined Functions

Introduction to User Defined Functions A function is a group of statements that together perform a task. Every C++ program has at least one function, which is main(), and all the most trivial programs can define additional functions. We have study about #define in previous lessons. Functions...

Program: Check given number for Prime Number

Program: Check given number for Prime Number We know about prime number is a number which is greater than one and can only divide by 1 or by its own number. In this program we check the given number for prime number. #include <iostream> using namespace std; int main() { int n; ...

Dec 12, 2015

Use of goto Statement

Using goto Statement goto statement is used to jump on a particular location in a program defined by label. Label is a name given to a location.  Label is defined by a <locationName> followed by a colon. goto is use with goto <labelName>; syntax of label & goto statment 1; label:...

Dec 11, 2015

Use of Continue Statement

Using Continue Statement Continue statement is used to skip the current iteration and force to execute next iteration by skipping any code after continue statement inside a loop. In simple term whenever you encounter continue statement in a loop it will skip the current pass execute next pass and...