C program to print array elements using pointer || Pointers || C Programming
In this, we are going to print elements of an array by using Pointers in C Programming Language.

 

#include <stdio.h>
int main()
{
    int x[5];
    int i = 0;
    // inputing the elements of an array
    printf("Input 5 elements:\n");
    for (int i = 0; i < 5; i++)
    {
        scanf("%d", x + i);
    }

    //printing values of an array
    for (int i = 0; i < 5; i++)
    {
        printf("%d ", *(x + i));
    }
    return 0;
}

//..........Coded by Ananya Maurya

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post