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.

Related Posts:

  • Data types in C      In the previous post we learn about what is Variable in C language.In this post we will learn Data type in C.The data t… Read More
  • 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 arra… Read More
  • what is one dimensional array Array is collection of similar type of data type.In the previous post we learn about what is array. In this post we learn what is one dimensional … Read More
  • C programming language C programming language:what is C programming language: C is a Computer Programming language developed at AT & T's Bell Laboratories,USA in 1… Read More
  • what is high level language and low level language In the previous post we learnt about variable and data type.In this post we will learn about computer languages.Today computer can be programmed to u… Read More

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