Q:

C Program to print array in reverse

0

C Program to print array in reverse

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
#define MAX_SIZE 100     
int main()
{
    int arr[MAX_SIZE];
    int size, i;

   
    printf("Enter size of the array: ");
    scanf("%d", &size);

    
    printf("Enter elements in array: ");
    for(i=0; i<size; i++)
    {
        scanf("%d", &arr[i]);
    }

   
    printf("\nArray in reverse order: ");
    for(i = size-1; i>=0; i--)
    {
        printf("%d\t", arr[i]);
    }

    return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now