+ 1

Someone with codes using arrays in c programming

coding

20th Dec 2017, 10:16 AM
Mike Minar
Mike Minar - avatar
3 Respostas
+ 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]);    }   }
20th Dec 2017, 11:31 AM
James16
James16 - avatar
+ 4
What do you mean ? Please write more details about your question so that people can understand you :)
20th Dec 2017, 10:47 AM
James16
James16 - avatar
+ 1
@James @Mike is asking for a C code using array in it i think 😇😇
20th Dec 2017, 11:25 AM
Hack Erer
Hack Erer - avatar