1. >CPET
  2. >Computer Science
Found 3  QuestionsSET DEFAULT
Selected Filters
    CPET Computer Science Pointers and Arrays
Exams
Years
Subjects
Topics

List of top Computer Science Questions on Pointers and Arrays asked in CPET

What will be the output of the following C code?

# include <stdio.h>
int main()
{ int arr[5] = {1, 2, 3, 4, 5};
 int *ptr = arr;
  *(ptr + 2) = *(ptr + 4) + *(ptr + 1);
  printf("%d\n", arr[2]);
  return 0; }
  • CPET - 2025
  • CPET
  • Computer Science
  • Pointers and Arrays
What is the output of the following C code?

#include <stdio.h>
void func(int arr[]) {
 sizeof(arr) == sizeof(int) * 5 ? printf("True\n") : printf("False\n");
}
int main() {
  int arr[5] = {0};
  func(arr);
  return 0;
}
  • CPET - 2025
  • CPET
  • Computer Science
  • Pointers and Arrays
The pointer that points to a memory location that has been already deallocated is known as:
  • CPET - 2025
  • CPET
  • Computer Science
  • Pointers and Arrays