0% found this document useful (0 votes)
17 views1 page

Array Manipulation Using Pointer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Array Manipulation Using Pointer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

ARRAY MANIPULATION USING POINTER

#include <stdio.h>

main()

int arr[] = {10, 20, 30, 40, 50};

int *ptr;

ptr = arr;

printf("Array elements using pointer:\n");

for(int i = 0; i < 5; i++)

printf("Element at index %d: %d\n", i, *(ptr + i));

*(ptr + 2) = 100;

*(ptr + 4) = 200;

printf("\n Modified array elements:\n");

for(int i = 0; i < 5; i++)

printf("Element at index %d: %d\n", i, *(ptr + i));

You might also like