This commit is contained in:
2021-04-27 13:05:20 +05:30
parent 1a134890b0
commit 9efbd42b29
3 changed files with 25 additions and 1 deletions

23
Array.c Normal file
View File

@@ -0,0 +1,23 @@
// WAP to print out an array of dynamic values.
void main() {
int r,n,i,a[10];
// To set range of array:
printf("\n Enter the range of array: \n");
scanf("%d", &n);
// To get values of array:
printf("\n Enter the elements of the array: \n");
r = 0;
for (i=0 ; i<=n; i++) {
scanf("%d", &a[i]);
}
// To print the elements of the array:
printf("\n The elements of the array are: \n");
for (i=0 ; i<=n; i++) {
r++;
printf("\n a[%d] = %d \n", r, a[i]);
}
}