ArrayReverse
This commit is contained in:
24
ArrayReverse.c
Normal file
24
ArrayReverse.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
// WAP to print out an array of dynamic values in rverse order.
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int i, r, a[10], n;
|
||||||
|
|
||||||
|
// 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");
|
||||||
|
n-1;
|
||||||
|
r = n;
|
||||||
|
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=n ; i>=0; i--) {
|
||||||
|
r--;
|
||||||
|
printf("\n a[%d] = %d \n", r, a[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
ArrayReverse.exe
Normal file
BIN
ArrayReverse.exe
Normal file
Binary file not shown.
@@ -25,3 +25,4 @@
|
|||||||
|23 | MultiplicationTable.c | MultiplicationTable.exe | WAP to print the multiplication table for a given number |
|
|23 | MultiplicationTable.c | MultiplicationTable.exe | WAP to print the multiplication table for a given number |
|
||||||
|24 | Divisible.c | Divisible.exe | WAP to find an addition of numbers which are >30, <100 & divisible by 7 |
|
|24 | Divisible.c | Divisible.exe | WAP to find an addition of numbers which are >30, <100 & divisible by 7 |
|
||||||
|25 | Array.c | Array.exe | WAP to print out an array of dynamic values |
|
|25 | Array.c | Array.exe | WAP to print out an array of dynamic values |
|
||||||
|
|26 | ArrayReverse.c | ArrayReverse.exe | WAP to print out an array of dynamic values in reverse order |
|
||||||
Reference in New Issue
Block a user