#Ask
11 messages ยท Page 1 of 1 (latest)
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.
When you want a numbered sequence of elements.
what is it with the exam type questions here
i just learned a bit about it.. i only use it to rewrite input
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;
}
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.
๐ ๐