You are on page 1of 2

Introduce variables i,k,y,y1,y2,j

Using the character array:


char s[20][100],t[20],d[20]

Display: Enter number of strings(maximum of 16) that you will be using:


Record answer as k

If 0<k<=16
Display: Enter information:
Record answer as s[i]
Then,
Display: Entered data:
(Data… named as s[i])

Next,
Display: (1) Add data
(2) Remove data
(3) Exit program
Chosen number:
Record answer as y

If y = 1
Display: How many strings do you want to add(16-‘k’ strings left):
Record answer as y2

If y2 <= 16-k
Display: Entered data:
(Data… named s[i])

If y2>16-k
Display: Invalid! input is greater than the maximum strings

Return to the screen wherein the user inputs the strings.

If y = 2
Display: How many strings do you want to erase:
Record answer as y1

If y1 > k
Display: Invalid! input cannot remove string more than the previous strings.

If y1<=k
k=k-y1
Display the data named s[i])

Return to the screen wherein the user inputs the strings.


}
If y = 3
The program is then stopped, and the program would exit.

If 0 > k or k > 16
Display: Invalid input")

You might also like