#include <stdio.h>
#include <conio.h>
#define S 5
main()
{
int arr[S], i;
int *ptr = arr;
printf(" Enter %d elements of array \n ", S);
for( i = 0; i < S; i++ )
scanf(" %d ", ptr + i );
printf(" Array elements are \n " );
for( i = 0; i < S; i++ )
printf(" %d %d %d %d \n ", *(ptr + i), *(i + ptr),ptr[i],i[ptr] );
return 0;
}
OUTPUT:
Enter 5 elements of array
1
2
4
7
5
Array elements are
1 1 1 1
2 2 2 2
4 4 4 4
7 7 7 7
5 5 5 5
ALSO READ:
-- Program To Understand Working Of Address Concept.
-- Program On Use Of Array & Pointer Concept Together.
-- Program On Pointers & 2 - Dimensional Array.
-- Program On Strings Into Array Of Pointers.
-- Program To Accept & Add Ten Numbers Using Pointers.
-- Program To Implement Minimum Spanning Tree Using Functions, Pointers & Structures.
-- Program To Implement 8 Queens Problem Using Arrays, Pointers & Functions.
-- Program To Implement Quick Sort Using Pointers, Functions & Arrays.
-- Program With Algorithm To Implement Bubble Sort Using Pointers.
-- Program To Implement Recursive Algorithm Using Pointers.
-- Program On Strings Into Array Of Pointers.
-- Program On Pointers & 2 - Dimensional Array.
-- Program On Use Of Array & Pointer Concept Together.
-- Program On Arithmetic Calculations Using Pointers.
-- Program To Add Two Numbers Using Pointers.
-- Program To Accept & Add Ten Numbers Using Pointers.
... Back To C Program Index.
Comments
Post a Comment
Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...
Experienced guys can share their resumes at admin@interview-made-easy.com