0% found this document useful (0 votes)
42 views1 page

North South University Department of Electrical and Computer Engineering CSE 215L: Programming Language II Lab Lab

1) Declare and initialize a 6 element integer array with user input, calculate and print the average. Calculate the percentage of numbers above the average. 2) Take a number from the user, generate that many Fibonacci numbers and store in an array. Display the array. 3) Take a 3x3 array initialized with given values, calculate and print the sum for each row, column and both diagonals. 4) Take an integer array, print only numbers in consecutive orders of 3.

Uploaded by

Tasfiul Hedayet
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
42 views1 page

North South University Department of Electrical and Computer Engineering CSE 215L: Programming Language II Lab Lab

1) Declare and initialize a 6 element integer array with user input, calculate and print the average. Calculate the percentage of numbers above the average. 2) Take a number from the user, generate that many Fibonacci numbers and store in an array. Display the array. 3) Take a 3x3 array initialized with given values, calculate and print the sum for each row, column and both diagonals. 4) Take an integer array, print only numbers in consecutive orders of 3.

Uploaded by

Tasfiul Hedayet
Copyright
© © All Rights Reserved
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/ 1

North South University

Department of Electrical and Computer Engineering


CSE 215L: Programming Language II Lab

Lab – 4: Array

Objective:
● To learn about array
● To learn to use array to solve different problems

Task:
1. Declare an integer array of size 6, initialize it with user input, calculate and print the average.
Now calculate the percentage of numbers that are above that average.

For example: if 3 of the array elements are greater than average, percentage is: 3 * 100 / 6 = 50%

2. Take an integer from user, generate that many fibonacci numbers and store in an array.
Display the array.
Sample output:
Enter a number: 8
First 8 Fibonacci numbers: 0 1 1 2 3 5 8 13

3. Take a 3X3 array and initialize it with these values:


3 4 9
2 9 11
4 6 0
Calculate and print the sum for each row, column and both diagonals.

4. Take an integer array and print only the numbers that are in consecutive orders of 3.
Enter size: 12

Enter numbers: 1 2 3 2 2 2 11 4 4 4 3 3

Output: 2 4

You might also like