The document outlines a series of programming tasks and exercises related to arrays, matrices, structures, and data manipulation in C. It includes tasks such as displaying elements at even and odd positions, sorting numbers with frequency, performing matrix operations, and implementing structures for storing employee and phone number information. Additionally, it covers cricket score recording and student information management using structures.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views3 pages
Probelms
The document outlines a series of programming tasks and exercises related to arrays, matrices, structures, and data manipulation in C. It includes tasks such as displaying elements at even and odd positions, sorting numbers with frequency, performing matrix operations, and implementing structures for storing employee and phone number information. Additionally, it covers cricket score recording and student information management using structures.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
1. WAP that will read an array of integers.
The program should display the elements appearing
at even and odd subscript position separately. 2. Some repeated random numbers are given, write a program to print them in increasing order with their frequency. 3. (a) What will be the output of the following code snippets? int a[ 5] = {5,1,15,20,25}; int i,j,k = 1,m; i = ++a[1]; j = a[1]++; m = a[i++]; printf(“\n%d %d %d”,i,j,m); (b) If a[i]=i++ is undefined, then by the same reson i=i+1 should also be undefined. But it is not so. Why? 4. WAP that will read 2 arrays. Sum individual elements of both arrays in reverse order and stores it in third array. Display the third array. 5. WAP to insert an array at the beginning of another array. 6. WAP to send all the negative elements of an array to the end without altering the original sequence. for e.g. If array contains 5 -3 2 6 8 -4 7 -6 9 -1 then the resultant array should be 5 2 6 8 7 9 -3 -4 -6 -1 . you may use two arrays. 7. WAP to left rotate an array by one element. 8. WAP to left rotate an array by n elements, where value of n will be provided by user. 9. Input a 3 * 3 matrix using keyboard, write a program to convert it in to 4 *4 matrix by adding corresponding row and columns. 10. WAP to prepare a one-dimensional array a[n2] from a 2-dimensional array m[nxn] that will have all the elements of array m if they are stored in row major form and a one-dim array b[n2] in column-major form. for example, for the following array— 1234 5678 9 10 11 12 13 14 15 16 The resultant array a will be 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16, and the resultant array b will be 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 11. WAP to obtain the determinant value of a matrix. 12. WAP to read a line of text from the keyboard and display the following information on the screen: 1. number of words 2. number of characters 13. Explain the difference between Structure and Union with example. 14. WAP to store information of 10 employees and to display information of an employee depending upon the employee number input from the user. 15. (a) Point out the error if any in the following code typedef struct { int data; NODEPTR link; }*NODEPTR; (b) How will you eliminate the above problem? 16. A phone number such as (011)711 8802 can be thought of as having three parts: the area code(011), the exchange(711), and the number (8802).write a program that uses a structure to store these three parts of a phone number separately. Call the structure phone. Create an array to store 20 records of its member wherein each record stores the memberno, member name and phone number of phone type. Have the user input the information for all records and then display the entire information on the screen. 17. WAP to record score of a cricket match. one array stores information of batting team such as batsman's name, run scored, indication if out mode by which out along with total runs, overs played, total overs and extras. The other array stores information about bowling team such as bowler's name, overs bowled, maiden overs, runs given and wickets taken. The program reads in the above information and depending upon the user's choice, it displays either the batting team's information or the bowling team's information. 18. WAP to make a structure named "student" having following as structure member:1) name 2) roll-no 3) marks of three subjects viz. English, hindi, maths. do the following operations using the structure: a) accept name, roll no and marks in three subjects. b) calculate total and percentage. c) show the information on the screen in given below format XYZ school half yearly examination Name: roll no: Marks in Hindi: Marks in English: Marks in Maths: --------------------------------------- Total marks: per: