HTML

Array:
An array is a collection of similar datatypes.
The size and type of array can not be changed after its declaration.
Array index starts with zero.
Arrays are classified into two types
1. One-dimensional array
2. Multidimensional array.

1. One-dimensional array

Declaration:
Syntax: datatype array_name[array_size];
Initialization:
We can declare an array by specifying its type and size and by both.
1. int array[10]={1,2,3,4};
2. int arr[]= {10,20,30,40};

2. Multidimensional array.

Declaration:
Syntax: datatype array_name[array_size][array_size][array_size];
Ex: int names[10][20];

 Task-1:




Output:

Task-2:

Output:

Task-3:

Output:

Files:
A file represents sequence of bytes on the disk where a group of related data is stored.
File is created for permanent storage of data.
Files are two types
1. Text files:
Text files are the normal .txt files that can easily create using notepad or any simple text editors.
All the data in this files are as plain text.
We can easily edit or delete the contents in the files.
These are easily readable with least security.
It takes high storage space.
2. Binary files
These are mostly .bin files which are present in our computer.
These files stores the data in binary format(0's and 1's).
It can hold higher amount of data and are not easily readable.
It provides better security compared with text files.

We can perform four major operations on the file. either text or binary.
1. Creating a new file.
2. Opening a existing file.
3. Closing a file
4. Reading from and writing information to a file.
Task-1:

Output:


Task-2:

output:

Task-3:

Output:

Ex:

Output: