Thursday, February 28, 2013

C Language Example # 28 Array Example : Create and Display value from Array


C Language Example # 28 Array Example : Create and Display value from Array.

* Program will create array and will display value from it.

//Written by Latest Technology Guide    
//Title : C Language Example # 28 Array Example : Create and Display value from Array.



#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a[5]={0},i;

printf("\t\t\t : Array Value is :");
for(i=0;i<5;i++)
printf("\na[%d] = %d",i,a[i]);

printf("\n\n\t\t\t : Now Enter Value for Array A : \n");

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

printf("\n\n\t\t\t : Now See New Value of Array A : ");

for(i=0;i<5;i++)
printf("\na[%d] = %d",i,a[i]);

getch();
}


Output:

* Program will display value from array.

--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 28 Array Example : Create and Display value from Array.


* Program will create static array.
* Program will fetch value from user and will store into array..
* Program will display value from array.

Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

No comments:

Post a Comment