0% found this document useful (0 votes)
14 views39 pages

3 Arrays

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views39 pages

3 Arrays

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

TASK # 44– Single Dimension Array(DECLARING, INITIALIZING, TRAVERSING) p

1) Type the code  Discuss Worksho


2) What do the uninitialized array elements contain ?  Discuss
TASK # 45– Single Dimension Array p
Worksho

1. Declare an integer array of 10 elements


2. Using FOR, get 10 numbers from the user in the array.
3. Print the value of each element on the screen followed by the sum of all
numbers.
4. Find out the average also and print
5. it.
(hint : sum / 10)
6. Find the number of elements
that are above and below
the average in
the array and print them
on the screen like

Solution on the next slide


SOLUTION 45– p
Worksho
TASK # 46– Single Dimension Array(DECLARING, INITIALIZING, TRAVERSING) p
1) Type the code  Discuss Worksho

h e a rray
se t
Traver g the
usin
a ch … loop
Fore
p
TASK # 47– Worksho

1. Declare an array of String type having


5 elements
2. Accept Customer names in the
elements.
3. Traverse the array using Foreach..loop
TASK # 48–Passing Array to a function and printing values p
Worksho
Type the code  Discuss
TASK # 49– Worksho
p

1) Declare the following two integer arrays with numbers.

2) Write a program to pass the arrays to the function that will


find the minimum number in the array. The function should
print the array list vertically followed by the minimum
number.

3) Hint : Compare the first array element with others in the


list. Replace if first element is greater.

Solution on the next slide


SOLUTION 49– p
Worksho
TASK # 50– Worksho
p

1) Declare the following two integer arrays with numbers.

2) Write a program to pass the arrays to the function that will


find the maximum number in the array. The function
should print the array list vertically followed by the
maximum number.

Solution on the next slide


SOLUTION 50– p
Worksho
TASK # 51– Multidimensional array p
1) Type the code Execute Discuss Worksho
TASK # 52– Multidimensional array (same line initialization & declaration) p
1) Type the code Execute Discuss Worksho
TASK # 53– Multidimensional array (same line Worksho
p

initialization & declaration)

1) Declare a two dimensional array (3 X 3 )and initialize it with


1-9 numbers.
2) Print the matrix.
3) Add 2 to all the even and 3 to all the odd numbers in the
array.
4) Print the resultant matrix again
TASK # 54– Multidimensional array (3x3x3) p
Type the code Execute Discuss Worksho
TASK # 55– Jagged Array (initializing and traversing) p
Type the code Execute Discuss Worksho
TASK # 56– Jagged Array (declaration, initialization combined and Traversing) p
Type the code Execute Discuss Worksho
TASK # 57– C# Params p
Type the code Execute Discuss Worksho
TASK # 58– C# Params p
Type the code Execute Discuss Worksho
TASK # 59 – C# Array class p
–Type the code Execute Discuss Worksho
TASK # 60 – C# Array class p
–Type the code Execute Discuss Worksho
TASK # 61 – Command Line Arguments p
–Type the code Execute Discuss Worksho

You might also like