+ 1
Someone with codes using arrays in c programming
coding
3 Answers
+ 5
EXAMPLE FOR C ARRAYS:
int a[10]; // integer arraychar b[10]; // character array i.e. string
TYPES OF C ARRAYS:
There are 2 types of C arrays. They are,
One dimensional arrayMulti dimensional arrayTwo dimensional arrayThree dimensional arrayfour dimensional array etc…
1. ONE DIMENSIONAL ARRAY IN C:
Syntax : data-type arr_name[array_size];
#include<stdio.h>
int main()
{
int i;
int arr[5] = {10,20,30,40,50};
// declaring and Initializing array in C
//To initialize all array elements to 0, use int arr[5]={0};
/* Above array can be initialized as below also
arr[0] = 10;
arr[1] = 20;
arr[2] = 30;
arr[3] = 40;
arr[4] = 50; */
for (i=0;i<5;i++)
{
// Accessing each variable
printf("value of arr[%d] is %d \n", i, arr[i]);
}
}
+ 4
What do you mean ? Please write more details about your question so that people can understand you :)
+ 1
@James
@Mike is asking for a C code using array in it
i think 😇😇