ASSIGNMENT 7-ARRAY , STRING AND POINTER
ONE DIMENSIONAL ARRAY
- WAP that reads 10 integers from the keyboard , stores them in an array and displays entered numbers on the screen.
- WAP to illustrate the memory location allocated by each array element.
- WAP that reads marks percentage in an examination of 10 students . Calculate and display the average marks.
- WAP to sort n numbers in ascending / descending order.
- WAP to search an element in an array and display the index of it.
- WAP that ask for numbers from users , store them in an array and find the maximum and minimum number of them.
- WAP to read marks of n students and print out top five .
- WAP to read an array of length N. Display the total count for positive number , negative numbers and zeros separately.
- WAP to read n numbers from the keyboard and store them in an array. Add even numbers and odd numbers separately and display the result.
- WAP to read n numbers in an array . Pass this array to a function which finds and displays the sum of even numbers only and the product of odd numbers only.
TWO DIMENSIONAL ARRAY
- WAP to initialize a 2-D array and display its elements.
- WAP to read a matrix of size 2*3 from the user and display it on screen.
- WAP to read two m*n matrices and display their sum.
- WAP to illustrate passing an array to function one element at a time.
- WAP to illustrate passing an entire array to a function.
- WAP to read 10 numbers and reorder them in ascending order using function sor(),read(), display().
- WAP to define three user defined function for reading , processing and displaying of 2*3 matrices . Double the matrix element and display it.
- WAP to read the order of the matrix and its elements . Find the transpose matrix of the matrix.
- WAP to read the order of a square matrix and its elements from the keyboard. Find the sum of diagonal elements of the matrix.
- WAP that asks the order of two matrices and read these matrices from user . Find the product matrix if order of matrices is suitable for multiplication.
- WAP to read the order of two matrices from the user . Read elements of the matrices using function and then find product of matrices . Finally , display the resultant matrix using another function.
STRING
- WAP to read the name of 5 different people using an array of strings and display them.
- WAP to find out the length of string input from the user using the library function strlen() function.
- WAP to copy one string to another using strcpy() function.
- WAP to concatenate two strings using strcat() function.
- WAP to illustrate the use of strcmp() function.
- WAP to illustrate the use of strrev() function.
- WAP to read a string and check whether it is palindrome or not
- WAP that reads a string from the keyboard until the user presses an enter key and counts the vowels , consonants, semicolons,commas separately in the string.
- WAP to read the names of five persons and sort them to display in ascending order.
- WAP to concatenate two strings without using string handling built-in functions.
- WAP which reads your name from the keyboard and displays a list of ASCII codes which represent your name.
- WAP that takes a string from the user and passes it to a function . The function should find and return the number of words in the string. In the main program, display the number of words.
- WAP to read a string and search a specified word in the given string.
- WAP to reverse string using recursive function with swapping.
- WAP to display the following pattern
Enter a string: COMPUTER
C
CO
COM
COMP
COMPU
COMPUT
COMPUTE
COMPUTER
Enter a string: HELLO
H
HE
HEL
HELL
HELLO
HELL
HEL
HE
H
Enter a string: KNOW
K
KN
KNO
KNOW
NOW
OW
W
Enter a string: PROGRAM
P
PR
PRO
PROG
PROGR
PROGRA
PROGRAM
ROGRAM
OGRAM
GRAM
RAM
AM
M
Enter a string: PROGRAM
Enter number of rows: 5
P
R O
G R A
M P R O
G R A M P
R O G R A M
Enter a string: KNOWPROGRAM
Enter number of rows: 9
K
N O
W P R
O G R A
M K N O W
P R O G R A
M K N O W P R
O G R A M K N O
W P R O G R A M K
N O W P R O G R A M
POINTER
- WAP to initialize an one - dimensional array and display its elements with their memory address using array name as a pointer.
- WAP to read marks of 10 students secured in a subject and store them in an array using pointer notation. Calculate average marks of them and display them on screen.
- WAP to define two matrices of order m*n using pointer notation. Read elements of the matrices from the user and add them and display the sum using a pointer.
- WAP to define two matrices of order m*n using pointer notation. Read elements of the matrices from the user and multiply them and display the product using a pointer.
- WAP to swap the value of two variables using pointer notation or call by reference.