Single Dimensional Array In C Example - C

How to code One dimensional array in c programming language?

Snippet Code


  
Rate this page :
  [ 0 votes]

Single dimensional array is also called as vectors. They simply represents and store the data in linear form. Here numbers[] is the array available, which is used to store 5 elements in one array.

#include <stdio.h> int main() { int numbers[]={1,2,3,4,5}; int i; printf("Array elements are\n"); for(i=0;i<=4;i++) printf("%d\n",numbers[i]); return 0; }

Tags


Ask Questions

Ask Question