Railways Exam  >  Railways Questions  >   Which of the following operations cannot be ... Start Learning for Free
Which of the following operations cannot be performed on pointers in C?
  • a)
    Addition of two pointers
  • b)
    Subtraction of a number from a pointer
  • c)
    Subtraction of one pointer from another
  • d)
    Addition of a number to a pointer
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Which of the following operations cannot be performed on pointers in ...
There are operations like increment, decrement, etc that can be performed on printers but there are operation that can’t be performed on pointers are –addition of 2 addresses; Division of 2 addresses; Modulo operation on pointer; bitwise AND, OR, XOR operations on pointer; NOT operation on pointer.
View all questions of this test
Most Upvoted Answer
Which of the following operations cannot be performed on pointers in ...
Explanation:
In C programming language, pointers are variables that store memory addresses of other variables. Pointers can be used to perform various operations like accessing memory locations, manipulating data, and performing arithmetic operations. However, there are certain operations that cannot be performed on pointers.

Addition of two pointers:
Adding two pointers together is not allowed in C. This operation is not meaningful because adding two memory addresses does not provide any useful result. It doesn't make sense to add the addresses of two variables or memory locations.

Subtraction of a number from a pointer:
Subtracting a number from a pointer is a valid operation in C. When a number is subtracted from a pointer, the resulting pointer points to a memory location that is "number" units before the original pointer location. This is useful in scenarios where you want to access a specific element in an array based on its index.

Subtraction of one pointer from another:
Subtracting one pointer from another is a valid operation in C. This operation yields the number of elements between the two pointers. It is useful in scenarios where you want to determine the distance between two elements in an array or measure the size of a dynamically allocated memory block.

Addition of a number to a pointer:
Adding a number to a pointer is a valid operation in C. When a number is added to a pointer, the resulting pointer points to a memory location that is "number" units after the original pointer location. This is useful in scenarios where you want to access a specific element in an array based on its index.

Therefore, the correct answer is option 'A' - Addition of two pointers cannot be performed in C.
Explore Courses for Railways exam
Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer?
Question Description
Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? for Railways 2024 is part of Railways preparation. The Question and answers have been prepared according to the Railways exam syllabus. Information about Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? covers all topics & solutions for Railways 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer?.
Solutions for Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Railways. Download more important topics, notes, lectures and mock test series for Railways Exam by signing up for free.
Here you can find the meaning of Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer?, a detailed solution for Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? has been provided alongside types of Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following operations cannot be performed on pointers in C?a)Addition of two pointersb)Subtraction of a number from a pointerc)Subtraction of one pointer from anotherd)Addition of a number to a pointerCorrect answer is option 'A'. Can you explain this answer? tests, examples and also practice Railways tests.
Explore Courses for Railways exam

Top Courses for Railways

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev