Sunday, December 31, 2017

WAP in c++ to perform basic operations on two complex numbers using structures

Aim : Using structures write a menu driven program to add, subtract and Multiply and divide two complex numbers

CODE:

OUTPUT:


WAP to perform basic operations in a 2D array (using user defined functions)

Aim : Write a menu driven program to show following operations in a 2-D array (using user defined functions)

Menu
1. Adding two 2-d arrays
2. Subtracting two 2-d arrays
3. Multiplying two 2-d arrays
4. Check whether two 2-d arrays are equivalent or not
5. Display upper triangular matrix
6. Display lower triangular matrix
7. Display and find sum of diagonal elements of a 2-d array
8. Display and find the row-wise sum of a 2-d array
9. Display and find the column-wise sum of a 2-d array
10. Quit

CODE:
OUTPUT:

WAP to perform basic operations in a 1D array (using user defined functions)

Aim : Write a menu driven program to show following operations in a 1-D array (using user defined functions)

Menu
1. Creation of an array
2. Searching array using
     - linear search method.
     - binary search method.
3. Sorting array using
    - selection sort
    - bubble sort
    - insertion sort
    - merge sort
4. Merge two arrays of integers in ascending or descending order
5. Inserting an element at ith position
6. Deleting an element from an array
7. Quit

CODE:

OUTPUT: