Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

to print an array's(length of n) odd elements in reverse order

0 votes
asked Feb 23, 2018 by anonymous

1 Answer

+1 vote
answered Feb 26, 2018 by Bruno Daniel (180 points)
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {
    
    int size;
    
    
    printf("Quantos elementos quer: ");
    scanf("%d",&size);
    
        int v[size];
    
    for(int i=0;i<size;i++)
    {
        printf("Position %d: ",i+1);
        scanf("%d",&v[i]);
    }
    
    for(int i=size-1;i>=0;i--)
    {
        printf("Position %d: %d\n",i+1,v[i]);       
    }

    return (EXIT_SUCCESS);
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...