Extra 5% OFF Use Code: OL05
Free Shipping over ₹999

Access array element Element using pointer

#include <stdio.h>
int main() {
    int data[5];

    printf("Enter elements: ");
    for (int i = 0; i < 5; ++i)
        scanf("%d", data + i);

    printf("You entered: \n");
    for (int i = 0; i < 5; ++i)
        printf("%d\n", *(data + i));
    return 0;
}

    Leave a Reply

    Your email address will not be published.

    Need Help?