# Algorithm and Flowchart for Addition of two numbers # Algorithm and Flowchart for Sum of two numbers In this post, we will see an algorithm and flowchart to add two numbers. It will be applicable to write program in any programming language. Required knowledge: Basics of Algorithm writing and… Continue Reading Algorithm and Flowchart to add two numbers

In this post, we will see a C Program to read two number inputs from user and display the sum. The program below accepts two numbers from user and perform basic arithmetic operation(addition) using + operator and display the sum on screen. For algorithm & flowchart to add two numbers,… Continue Reading C PROGRAM TO ADD TWO NUMBERS / INTEGERS

Learning the operators of the Java programming language is a good place to start. Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result. Increment/Decrement operators: Increment and decrement operators are known as Unary operators. They require only one operand. Increment operator:… Continue Reading Java program for increment and decrement (pre and post)

In programming, we execute certain section of code based on whether the specified condition is true or false which is known only at run time. For such cases we use “control flow statements”. Simple if if……else nested if if else if Simple if: Simple If statement is the most basic… Continue Reading Java program to implement simple if-else

Factorial: Factorial of a non-negative integer n, is the product of all positive integers less than or equal to n.  It is represented as n!. n! = 1 * 2 * 3 * 4 * ………………… * (n-1) * n. for example,  5! can be calculated as 5 * 4… Continue Reading Java program to find Factorial of a given number using Recursion

This program explains about how you can  swap  values within a variable without using the third variable. Algorithm: Step 1 : START Step 2 : Declare two variables, say a,b. Step 3 : Add a and b and store to a. Step 4 : Subtract b from a and store… Continue Reading Java program to swap two variables without using third variable

The Factorial of a non-negative number n is the product of all positive integers less than or equal to n and is represented by n!. n! = 1 * 2 * 3 * 4 * 5 * ………………………..  * (n-1) * n. for example 5! can be calculated as 1… Continue Reading Java program to find factorial of a given number

In this program, user is asked to enter two integers. Then, the product of those two integers is stored in a variable and displayed on the screen. Algorithm: Step 1: Start. Step 2: Declare variables, say a and b. Step 3: result = a * b. Step 4: Display result.… Continue Reading Java Program to find product of two numbers

Square frame pattern is designed in accordance to the number of rows user has entered. In this java program, the user is asked to enter number of rows. It displays a hallow square based on number of rows. Algorithm: Step 1: Start. Step 2: Read number of rows to be… Continue Reading Java Program to print Hallow square pattern

A number is said to be even if it is divisible by 2.  otherwise odd. Let us now see an example of a java program to determine whether the given number is an odd or even number. Algorithm: Step 1: Start. Step 2:  Read n. Step 3:  if n%2 ==… Continue Reading Java program to check whether the given number is even or odd

A series of numbers in which each number is the sum of the two preceding numbers. for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. The first two numbers of fibonacci series are 0 and 1. Algorithm: Step 1: START. Step 2: Declare variables a,b,c.… Continue Reading Java program to Generate Fibonacci sequence

A number is said to be prime if it is divisible by 1 and itself. otherwise it is composite. Algorithm Step 1: START. Step 2: read the number n. Step 3: Check the divisibility of the number from 2 to n/2. Step 4: If number is divisible by any of… Continue Reading Java program to check whether the given number is prime or not

In this Program the user is asked to enter two numbers. Based on the numbers the division of two numbers is per Algorithm: Step 1: Start. Step 2: Declare variables, say a, b and c. Step 3: c = a/b; Step 4: Display result. Step 5: Stop. Source code:

Continue Reading Java program for Division of two numbers

In this program user is asked to enter two integers and the sum operation is performed. Source code:

Output: C:\Users\Desktop\new>javac  Add.javaC:\Users\Desktop\new>java Add *** www.programmingposts.com *** << Addition of two numbers without using Third Variable >> Enter first number to be added: 9 Enter Second number to be added: 6… Continue Reading Java Program to add two numbers without using third variable

In this Programming Post, we will see an example program to get string of comma separated values from DataTable Column in C#.Net. Generally while working with DataTable, we may need to generate a comma (or any delimiter) separated string and even we may need to generate comma separated values with single… Continue Reading Get Comma (delimiter) Separated String from DataTable Column Values in C#.Net

C PROGRAM TO FIND COUNT OF DUPLICATE ELEMENTS IN AN ARRAY In this post we will see a simple C program to find the count of duplicate elements in an Array. In below program we will get the count of elements that are duplicated i.e. elements that are occurred more… Continue Reading C Program to count duplicate / repeated elements in an array

In this post we will see, generating a Financial Year string based on the given date. I have given code in C#.Net and VB.Net. C#.Net Method to Get Financial Year of a given Date :     /// <summary>     /// Method to Get Financial Year of a given Date    … Continue Reading Get Financial Year of a given Date in C#.Net / VB.Net