Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Monday, January 1, 2018

WAP in c++ using pointers to find the smallest and the largest element in a dynamically created array


Aim :  WAP in c++ using pointers to find the smallest and the largest element in a dynamically created array

CODE:

OUTPUT:


Write a program in C++ to implement queue as an array


Aim :  WAP in C++ to implement queue as an array

CODE:

OUTPUT:


WAP in C++ to implement stack as an array


Aim :  Write a program (WAP) in C++ to implement stack as an array

CODE:

OUTPUT:


Write a program in C++ to define the class bank shown below. Create an array of n objects and display the objects' details.

Aim : Write a program in C++ to define the class bank shown below. Create an array of n objects and display the objects' details.

class bank { 
private :
    Accno integer.
    Name character 20
    Acctype character 1 ('s','c') use enum
    Balance float
Public:
    Initial();
    Deposit();
    Withdrawl();
    Balance();
    Display();

}

CODE:

OUTPUT:


Sunday, December 31, 2017

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: