Anda di halaman 1dari 2

NOTICE

Data Structures Lab - Assignment 1


Last Date : Dec 20,2011 Attn : Students of BE III Semester CSE and IT

Part A- A Review of Programming in C Q1. Write a Program I. To find a. Area of Square, Rectangle, Triangle, Circle etc. b. Volume of Sphere, Cylinder, Cone, Cube etc. c. Simple Interest, Compound Interest. d. Average of two numbers. II. To exchange two variables having numeric values. a. Using third variable. b. Without using third variable. Q2. Write a program for following conversion a. Meters to Inches / Miles. b. Time to Numbers exp 5:30 to 5.5, 4:45 to 4.75 c. Rs. to Dollars / Pound using current conversion rate as input. d. Number of Overs (in terms of cricket ) to number of Overs ( in terms of numeric) example Number of Overs Criket Numeric 10.3 10.5 0.2 0.33 Q3. Write a program to a. Compare two number, and output for equal/larger/smaller. b. Find Max of three numbers c. Find Min of four numbers Q4. Input an amount and result mode of payment to pay that amount in minimum number of note of Indian currency. Exp: Input Rs. 723 Output 500 X 1 + 100 X 2 + 20 X 1 + 2 X 1 + 1 X 1 Q 5. Write a program to compute result of a student from marks in five subject, according to following rules. a. Student is passed if he/she passes in all subjects individually. b. Pass marks for a subject is 35%. c. Student is failed if secures less than 50% aggregate d. Grace marks can be given if fails in only ONE subject, maximum grace marks is 10 % of the secured marks in the failed subject e. Student result should also mention supplementary with subject(s) for completeness of information. f. Rest the result is computed as usual i.e. Distinctions for more than 70 %, I div for above 60%, II div for above 50% , Failed otherwise. Q 6. Display following series and find the sum and average of following series also (need not to do arithmetic calculations for arithmetic series) a. 1, -2, 3, -4, 5,.20 terms b. 1,1,2,3,5,7,20 terms c. 1,2,4,5,7,8,10.. <50 d. 2,5,4,10,6,15,8,.20 terms e. A,B,.. Z. f. A, C, E10 terms

Part B-

Array

Q 7. Write a program, which accepts 10 numbers and perform followings a. Print back the numbers which were input b. Print all even numbers c. Print all odd positioned numbers d. Print numbers in reverse order of input e. Print all +ve numbers f. Print all -ve numbers g. Find range of the numbers(Ranges =MAX-MIN) h. Find average of numbers i. Print all unique numbers j. Print all duplicate numbers k. Remove multiple occurrences of the numbers and display the unique. l. Sort the numbers in Ascending / Descending order. m. Search position of given number i.e. key. n. Search a number and give its number of occurrence(s), if any. o. Check if the given array is already sorted. Q 8. Write a program which inputs two arrays of 10 numbers each and perform followings a. Add / subtract two arrays and store in third one. b. Find number of Matches and Mismatches in two arrays (compare at corresponding locations). c. Find number of occurrences of elements of first array in other array, if any. d. Find if two give arrays are identical (Same). e. Find multiplication of two 1-D arrays (all elements are multiplied with all elements of other arrays). Q 9. Write a program which accept elements of matrix (let size 4X4) and perform followings. a. Find sum of rows b. Find sum of columns c. Find Min of matrix d. Display all diagonal elements e. Display upper triangular elements f. Display lower triangular elements g. Display second main diagonal elements h. Display elements in BAND i.e. nearby elements of main diagonal, including diagonals. i. Display Q 16 d to 16 h in appropriate format of matrix. j. Rotate matrix by 90 degree in clockwise / anticlockwise k. Transpose matrix l. ADD, SUB and MULTIPLY with other matrix ( input separately).

Anda mungkin juga menyukai