Recent Posts

Monday 22 January 2018

what is array

In the previous post we learn about Difference between compiler and interpreter .In this post we will learn what is array.

What is array:

  1. Array is used to store more than one values of same data type under a single variable name in continuous memory location.
  2. In array each value has a unique index number.
  3. values are start from zero(0).
  4. first value will be stored at index number zero.
  5. The address of first index value is also called as based address.
  6. To access value in array we have to write array name followed by index number in the bracket.
  7. If we don't write index number then by default first element value will be zero is accessed.


Syntax: Data type Array name [size of array];

program for print array elements:

#include <stdio.h>

void main()
{
int a[5]={2,4,6,8,10},b;
for(b=0;b<5;b++)
printf("\n%d",b[a]);
}

Output:
2
4
6
8
10

In the next post we will learn about one dimensional array and two dimensional array.

0 comments:

Post a Comment

Followers

Popular Posts

Categories

social media

Text Widget

Powered by Blogger.

About Me

My name is junaid khan and i am a full time blogger and author of a blog tutorial called tutorialpointsolution.

String function

In the previous post we learn about what is String .we know that string is a collection of two or more characters.In string we can store al...

Search This Blog

Technology

Adbox

Recent Post

Breaking

Recent In Internet

Comments

Facebook

Pages

Comments

Pages

Recent

Pages

Technology