FYBCS C Exercise_9

Set A. Write programs to solve the following problems 

 1. Write a program to accept n number and display the array in the reverse order. write separate function  to accept and display 

 2. Write a function for Linear Search, which accepts an array of n elements and a key asparameters and returns the position of key in the array and -1 if the key is not found. Accept nnumbers from the user, store them in an array. Accept the key to be searched and search it usingthis function. Display appropriate messages. 

 3. Write a function, which accepts an integer array and an integer as parameters and countsthe occurrences of the number in the array. 

 4. Write a program to accept n numbers and store all prime numbers in an array called prime.Display this array.

Set B. Write programs to solve the following problems

 1. Write a function to sort an array of n integers using Bubble sort method. Accept n numbersfrom the user, store them in an array and sort them using this function. Display the sorted array. 

 2. Write a program to accept a decimal number and convert it to binary, octal and hexadecimal.Write separate functions. 

3. Write a program to find the union and intersection of the two sets of integers (store it in two arrays). 
OR
3. Write a program to find the intersection of the two set of integers. store the intersection in another array 

4. Write a program to remove all duplicate elements from an array.  

Post a Comment

0 Comments