HOW to store some values in C anguage?
By using ARRAYS.
what do u mean by some values???
u can store value in variables or u can use dynamic memory allocation.
in variable u can store in standard variable or user defined variable like array or structure.
Use a loop, to read and store elements in an array.
For example, suppose you have an integer array a.
int a[MAX_SIZE];
int n;
int i;
scanf("%d", &n);
for (i = 0; i < n; ++i)
{
scanf("%d", &a[i]);
}
The above code snippet will first read the number of elements n
, and then read n
elements one-by-one and store it in the array.
This is the way you do in C. For other languages, the idea is same. Only make syntax-specific changes.