Tagged
• Flow Chart
•

# Problem Statement

```1Problem Description : Given two integers Write Algorithm, Flowchart and Program to display them in ascending order.2
3Example 1 : 4    Input  : 3, 15    Output : 1, 36    Explanation : 1, 3 are in ascending order 7
8Example 2 : 9    Input  : 5, 210    Output : 2, 511    Explanation : 2, 5 are in ascending order ```

# Algorithm

`1Input :  Two numbers n1, n22Step 1:  Start3Step 2:  Read number n1, n2 4Step 3:  if n1 <= n25Step 4:  print n1, n2 and go to step 76Step 5:  else 7Step 6:  print n2, n1 and go to step 78step 7:  Stop9Output: n1, n2 in sorted order`

# Code Implementation

1. Java
2. Golang
3. C

```1import java.util.Scanner;2
3public class SortTwoNumbers {4
5    public static void main(String[] args) {6
7        int n1, n2;8        Scanner sc = new Scanner(System.in);9
10        System.out.print("Enter n1: ");11        n1 = sc.nextInt();12        System.out.print("Enter n2: ");13        n2 = sc.nextInt();14
15        if (n1 <= n2) {16            System.out.printf("%d, %d \n", n1, n2);17        } else {18            System.out.printf("%d, %d \n", n2, n1);19        }20    }21}```

Output 1 :

`1Input  : 54 122Output : 12 54`

Output 2 :

`1Input  : 12 212Output : 12 21`

• Flow Chart
•
...