Computer Science, asked by Anonymous, 1 year ago

*️⃣ Write a program to calculate three side of SI using structure with array. *️⃣

*️⃣ Question of C++ *️⃣

‼️ Spammers be away ‼️

Answers

Answered by chetan2222
0
Structure in C++

We have already dealt with arrays. Arrays are used to store similar type of data. Have you ever thought if there is any way to store dissimilar data?

The answer is yes. We use structures to store different types of data. For example, you are a student. Your name is a string and your phone number and roll_no are integers. So, here name, address and phone number are those different types of data. Here, structure comes in the picture.

Defining a Structure

The syntax for structure is:

struct structure_name
{
data-type member-1;
data-type member-2;
data-type member-3;
data-type member-4;
};

In our case, let's name the structure as student. The members of the structure in our case are name, roll_no and phone_number.

So, our structure will look like:

struct student
{
    int roll_no;
    std::string name;
    int phone_number;
};

thank you .


@chetan2222

Anonymous: Wht is this huh -_-
Answered by BrainlyEmpire
7

computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements, each identified by at least one array index or key. An array is stored such that the position of each element can be computed from its index tuple by a mathematical formula.

Attachments:
Similar questions