How to read and write data in an array?

Data Structure >   Array >   Array Introduction in Data Structure  

Short Question

965


Answer:

In this section you will learn how to read and write data in an array using c programming Language


#include<stdio.h>
void main ()
{
int array[10], n;
// Reading an array
printf("Enter size of an array");
scanf ("%d", &n);
printf("Enter array elements");
for (i=0;i<n;i++)
scanf ("%d", &array[i]);
// writing an array
printf("array elements are");
for (i=0;i<n;i++)
printf ("%d", array[i]);
}


This Particular section is dedicated to Question & Answer only. If you want learn more about Data Structure. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.