Friday, 14 August 2015

Array in C Language

Array in C Programming Language Full Information and With Some Examples

Array: - An array in c programming Language Act to Store Related Data Under a Single Variable name With an index, also known as a Subscript.

Simply:   a list or ordered grouping for variables of the same type ( or ) Collection of Similar Elements.

Program For Example
#include<stdio.h> 
#include<conio.h>
int main()
{

int marks[]={25,56,65,45,21};

float avg[2];
avg[0]=65.56;
avg[1]=32.52;

printf("%d\n",marks[0]);
printf("%d\n",marks[1]);

return 0;

}

Output
25
56

Explain : Here, 25 and 56 values coming outputs. Because, array list start [ 0 1 2 3 4 5.. ] .in above program [ 0 ] place insert 25 ,  [ 1 ] place insert 56. See printf  Display Only marks[0],marks[1]. Then Display the Array list select this Output. 

No comments:

Post a Comment