Friday, September 28, 2012

How to use Array Statement simple trick


#include<stdio.h>
#include<conio.h>
void main()
{
int i,a [5];
clrscr();
printf("Enter Velue");

for(i=0; a<=5; i++)
{
scanf("%d",&a[i]);
}

printf("Elements of Array");

for(i=0; a<=5; i++)
{
printf("\nA[i], %d",i, a[i]);
}
gethc();
}

Homework Define: Array 5-Times

Array is fixed size sequenced collection of elements of same type.

Note:
-Array is use to handle large amount of data
-Is collection of elements of same data type.

Syntax: How to declared Array Variable
data_type variable_name [size];
int a [5];
- It can be used with all the data type.
* float a [5];
* char a [5];
* double a [5];

- Index of Array always start from 0