Overview using arrays in program that require the need to st
Overview
using arrays in program that require the need to store a lot of data of the same data type. The following topic is designed to reinforce the importance of the concepts in this module.
Instructions
There are every day, real-life examples of arrays.
To fulfill the requirements for this discussion you will:
Identify two examples of arrays. Describe the array and why it is used. How is the array declared? Write the code to declare one of the array examples you described. Is there a better way to store this data? Why or why not? Research the topic using the internet to enhance your submission. Sources used in your research should be properly cited.
Solution
there are various ways in which arrays are used in real world or in day to day life. The two examples are store sequence of numbers such as roll numbers of students or call numbers of books in library management system. most important application is matrix implementation.
 
 array is a set of contigious memory locations which are capable of storing homogenuous data od same datatype. with the help of arrays concept we can overcome the problem using multiple variables of same datatypes.
 
 the syntax of array declaration is :
 <datatype>array_name[size of an array];
 eg: int array_demo[10];
 the array_demo consists of 10 locations of int type from index 0-9 that is capable of storing integer values.
 
 sample code for demostrating the work of an array:
#include<stdio.h>
int main()
 {
 int array_demo[10],index;
 printf(\"enter the elements into array_demo:\");
 for(index=0;index<10;index++)
 scanf(\"%d\",&array_demo[index]);
 for(index=0;index<10;index++)
 printf(\"\ the value at % index is : %d\",index,array_demo[index]);
return 0;
 }
Arrays are better to store homogenuous data but not heterogenuous data. As the data is usually the mixture of both arrays doesnot satisfy the criteria.
 

