1. Write a program that declares an int array of 10 elements. Using only pointer notation, populate the array with scanf and print the elements with printf.
2. Write a program where an int pointer p points to a variable x which is initialized to 10. Using only the *, ++ and -- operators with p, (i) add 1 to the address of x, (ii) subtract 1 from x, (iii) add 1 to x.
3. Write a program that uses scanf to accept a word as string input. Using a pointer to a character array and without using array notation, compute the length of the string, i.e. until the NUL character is encountered.
4. Write a program to compute the sum of all elements of an int array using only pointers.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here