Input in Array Data structure by R4R Team

Array:
Array is the collection of different values having same data type.
-We have a integer Array that having all integer values.
-Character array is known as String.
-Here we Try to take input in the Array

program-

#include < stdio.h>
int main()
{
int arr[100]; //array
int n,i;
printf("Enter number of element you want in array\n")
;scanf("%d",&n);
printf("Enter elements in array\n");
// input of n elements in array
for(i=0;i< n;i++)
{
scanf("%d",&arr[i]);
}
return 0;
}


output-

Enter number of element you want in array
5
Enter elements in array
3 65 1 23 0

-In this program, firstly we take a input of the number that decide the number of value in array.
-Then using the loop we take input in array.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!