#Ask

11 messages ยท Page 1 of 1 (latest)

simple plover
#

In what situations can we use arrays in the C language?

bitter vortexBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

desert osprey
#

When you want a numbered sequence of elements.

magic timber
#

what is it with the exam type questions here

elder chasm
#

example

#include <stdio.h>

int main() {
    int input[5]; // save 5
    int i;

    // input array
    printf("This 5 input:\n");
    for (i = 0; i < 5; i++) {
        printf("Input-%d: ", i + 1);
        scanf("%d", &input[i]);
    }

    // show array
    printf("\nOutput:\n");
    for (i = 0; i < 5; i++) {
        printf("Input-%d: %d\n", i + 1, input[i]);
    }

    return 0;
}
trail raft
# simple plover In what situations can we use arrays in the C language?

Arrays in C are highly versatile and can be used in various situations to store and manage collections of data. Here are some common scenarios where arrays are particularly useful. Storing Large Amounts of Similar Data
If you have a lot of data of the same type (such as a list of numbers or characters), an array makes it easy to store all of that data in one place. For example, if you want to store test scores from multiple students.

elder chasm
#

๐Ÿ˜…๐Ÿ˜…

trail raft
#

I'm just trying to answer

#

Arrays are used to store and manipulate a collection of elements with the same data type in one variable Right?

#

I'm just learning too sorry