printing arrays through pointers

PHOTO EMBED

Mon Feb 07 2022 19:30:22 GMT+0000 (Coordinated Universal Time)

Saved by @m1racle23 #c

#include <stdio.h>

int main() {
    int marks[4];
    int *ptr;
    ptr = &marks[0];
    int i;
    
    for(i=0;i<4;i++){
        printf("enter the value of the marks: %d\n" , i+1);
        scanf("%d" , ptr);
        ptr++;
        
    }
     for(i=0;i<4;i++){
         printf(" the value of the marks %d is :%d\n" , i+1 , marks[i]);
     }
    
	//code
	return 0;
}
content_copyCOPY