0% found this document useful (0 votes)
18 views

Array

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Array

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

WEBEL COMPUTER TRAINING CENTRE

COMPUTER (CLASS – X EXAM ON ARRAY)

FULL MARKS: 56 TIME 1:30


Write the output of the following 3x2=6
A) int Q[ ] = {20, 22, 24};
Place all elements of P array and Q array in the array R one after the other.
(a) What will be the size of array R[ ] ?
(b) Write index position of first and last element?

B) Consider the given array and answer the questions given below:
int x[ ] = {4, 7, 9, 66, 72, 0, 16};
(a) What is the length of the array?
(b) What is the value in x[4]?

C) What is the difference between the linear search and the binary search technique?

WRITE THE CODE OF THE FOLLOWING (ANY 5) 10X5=50


1. Write a program to input 15 integer elements in an array and sort them in ascending
order using the bubble sort technique.

2. A double dimensional array is defined as N[4][4] to store numbers. Write a program


to find the sum of all even numbers and product of all odd numbers of the elements
stored in Double Dimensional Array (DDA). OR

Define a class to accept values into a 3 × 3 array and check if it is a special array. An
array is a special array if the sum of the even elements = sum of the odd elements.

3. Define a class to accept values into an array of double data type of size 20. Accept a
double value from user and search in the array using linear search method. If value is
found display message "Found" with its position where it is present in the array.
Otherwise display message "not found".
4. Define a class to accept values in integer array of size 10. Find sum of one digit
number and sum of two digit numbers entered. Display them separately.

5. Write a program to input integer elements into an array of size 20 and perform the
following operations:
a) Display largest number from the array.
b) Display smallest number from the array.
c) Display sum of all the elements of the array
d) Write a program to input forty words in an array. Arrange these words in
descending order of alphabets, using selection sort technique. Print the sorted
array. OR

Write a program to input and store roll numbers, names and marks in 3 subjects of n
number of students in five single dimensional arrays and display the remark based on
average marks as given below:
Average Marks Remark
85 — 100 Excellent
75 — 84 Distinction
60 — 74 First Class
40 — 59 Pass
Less than 40 Poor

6. Define a class to accept 10 characters from a user. Using bubble sort technique
arrange them in ascending order. Display the sorted array and original array. OR
Write a program to input and store roll number and total marks of 20 students. Using
Bubble Sort technique generate a merit list. Print the merit list in two columns
containing roll number and total marks in the below format:

Roll No. Total Marks


... ...
... ...
... ...

You might also like