TOUGH
TOUGH
Then do the
following (write separate programs for each, only the reading part is common).
2. Read in two integers n and m (n, m < 50). Read n integers in an array A. Read
m integers in an array B. Then do the following (write separate programs for
each part, only the reading part is common).
a) Find if there are any two elements x, y in A and an element z in B, such that
x+y=z
b) Copy in another array C all elements that are in both A and B (intersection)
c) Copy in another array C all elements that are in either A and B (union)
d) Copy in another array C all elements that are in A but not in B (difference)
3. Write a C program that reads an integer n and uses an array to efficiently find out
the first n prime numbers.
4. Read in an integer n, read in n integers and print the integer with the highest
frequency.
5. Read in an integer n, read in n numbers and find out the mean and mode.
6. Read in two names and compare them and print them in lexicographic (dictionary)
order.