diff --git a/ArrayReverse.c b/ArrayReverse.c new file mode 100644 index 0000000..d2f91fe --- /dev/null +++ b/ArrayReverse.c @@ -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]); + } +} \ No newline at end of file diff --git a/ArrayReverse.exe b/ArrayReverse.exe new file mode 100644 index 0000000..fa582cf Binary files /dev/null and b/ArrayReverse.exe differ diff --git a/Order Of Programs.md b/Order Of Programs.md index 8898677..11df9d5 100644 --- a/Order Of Programs.md +++ b/Order Of Programs.md @@ -24,4 +24,5 @@ |22 | Calculator.c | Calculator.exe | Write a menu driven program for calculator | |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 | -|25 | Array.c | Array.exe | WAP to print out an array of dynamic values | \ No newline at end of file +|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 | \ No newline at end of file