Embedded,C Programming,C,Linux

Sunday, June 3, 2018

Printing The Array Element of 1-D Array

Array-Array is a collection of same type of data like (int, char,Float).Array is stored in Continuous Memory Location .

For Example:

int boy[5]={11,12,13,14,15,16};

In this Statement boy is an array consisting of 5 member/Element.Like

boy[0]=11;
boy[1]=12;
boy[2]=13;
boy[3]=14;
boy[4]=15;
boy[5]=16;

Note :Array index start with 0 ,So Array index always  one less than Size of array.

//Program to Print Element of Array

#include <stdio.h>

int main()
{
int arr[6]={11,12,13,14,15,16};
    int i;
   
    for(i=0;i<6;i++)
    {
     
       printf("%d\n",arr[i]);
     
    }
return 0;

}




No comments:

Post a Comment

Finding COM PORT in ubuntu

 Hello ,In this post we see how to find COM port/Serial port in Ubuntu. Items Required 1.Usb to TTL cable  Step 1: Finding COM Port in Compu...