Important 30 C Programming Questions on Pointers, TechnoVlogs

Important 30 C Programming Questions on Pointers


Q1: Declare an integer variable, assign it a value, then create a pointer pointing to this variable and print the variable’s value using the pointer.

Expected Output:
Value of num using pointer: 10

Q2: Write a program to increment a variable's value using a pointer.

Expected Output:
Incremented value of num: 6

Q3: Print the addresses of three integer variables using pointers.

Expected Output:
Address of a:
Address of b:
Address of c:

Q4: Write a program that swaps two integer values using pointers.

Expected Output:
Before swap: a = 10, b = 20
After swap: a = 20, b = 10

Q5: Write a program that demonstrates pointer arithmetic by printing the address of an integer variable and the next address after incrementing the pointer.

Expected Output:
Address of num:
Address after incrementing pointer:

Q6: Use pointers to print each element of an integer array.

Expected Output:
Element 0: 1
Element 1: 2
Element 2: 3
Element 3: 4
Element 4: 5

Q7: Write a function that takes a pointer to an integer, doubles the integer’s value, and returns the result.

Expected Output:
Doubled value: 10

Q8: Print the value of a character variable using a pointer.

Expected Output:
Value of ch using pointer: A

Q9: Write a program that shows how a pointer can be used to access the elements of a 2D array.

Expected Output:
Element 0: 1
Element 1: 2
Element 2: 3
Element 3: 4

Q10: Use pointers to find the length of a string.

Expected Output:
Length of string: 5

Q11: Write a program that takes an array of integers and uses pointers to reverse the array.

Expected Output:
Reversed array: 5 4 3 2 1

Q12: Write a program to find the largest element in an array using pointers.

Expected Output:
Largest element: 7

Q13: Create a function that takes a pointer to an integer and changes the value to its negative.

Q14: Write a program that uses a pointer to calculate the sum of an array.

Q15: Use pointers to check if two integers are equal.

Q16: Create a function to count the number of vowels in a string using pointers.

Q17: Write a program to check if a character is present in a string using pointers.

Q18: Use pointers to find the minimum and maximum values in an array.

Q19: Write a function to swap two numbers in an array given their indices, using pointers.

Q20: Write a program that uses a pointer to access and modify elements of a 2D array.

Q21: Write a program that prints the ASCII values of each character in a string using pointers.

Q22: Create a function to copy the contents of one array to another using pointers.

Q23: Write a function that takes a pointer to an integer array and returns the average of its elements.

Q24: Use pointers to print a string in reverse order.

Q25: Write a program to demonstrate passing a pointer to a function and modifying the variable value.

Q26: Use pointers to concatenate two strings.

Q27: Write a program that swaps two characters in a string using pointers.

Q28: Write a program to print the elements of a float array using pointers.

Q29: Create a function that finds and prints the index of a given value in an integer array using pointers.

Q30: Write a program that takes an array of integers and a target integer and uses pointers to find the target integer in the array.

Social Share

Bikki Singh Instructor TechnoVlogs

Bikki Singh

Hi, I am the instructor of TechnoVlogs. I have a strong love for programming and enjoy teaching through practical examples. I made this site to help people improve their coding skills by solving real-world problems. With years of experience, my goal is to make learning programming easy and fun for everyone. Let's learn and grow together!