Question
Download Solution PDFWhich of the following is a valid relational operator in C?
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFExplanation:
Relational operators are used in C programming to compare two values or expressions. These operators evaluate the relationship between operands and return either true (non-zero value) or false (zero value) depending on the condition being tested.
Purpose: Relational operators are commonly used in conditional statements, loops, and decision-making constructs to control the flow of execution based on specific conditions.
List of Relational Operators in C:
- ==: Checks if two values are equal.
- !=: Checks if two values are not equal.
- <: Checks if the left operand is less than the right operand.
- >: Checks if the left operand is greater than the right operand.
- <=: Checks if the left operand is less than or equal to the right operand.
- >=: Checks if the left operand is greater than or equal to the right operand.
Example:
#includeint main() { int a = 5, b = 10; if (a != b) { printf("a is not equal to b\\n"); } else { printf("a is equal to b\\n"); } return 0; }
Output:
a is not equal to b
The != operator compares the values of a and b. Since 5 is not equal to 10, the condition evaluates to true, and the message "a is not equal to b" is printed*33333333333333
Last updated on Jul 2, 2025
-> The RRB JE CBT 2 Result 2025 has been released for 9 RRBs Zones (Ahmedabad, Bengaluru, Jammu-Srinagar, Kolkata, Malda, Mumbai, Ranchi, Secunderabad, and Thiruvananthapuram).
-> RRB JE CBT 2 Scorecard 2025 has been released along with cut off Marks.
-> RRB JE CBT 2 answer key 2025 for June 4 exam has been released at the official website.
-> Check Your Marks via RRB JE CBT 2 Rank Calculator 2025
-> RRB JE CBT 2 admit card 2025 has been released.
-> RRB JE CBT 2 city intimation slip 2025 for June 4 exam has been released at the official website.
-> RRB JE CBT 2 Cancelled Shift Exam 2025 will be conducted on June 4, 2025 in offline mode.
-> RRB JE CBT 2 Exam Analysis 2025 is Out, Candidates analysis their exam according to Shift 1 and 2 Questions and Answers.
-> The RRB JE Notification 2024 was released for 7951 vacancies for various posts of Junior Engineer, Depot Material Superintendent, Chemical & Metallurgical Assistant, Chemical Supervisor (Research) and Metallurgical Supervisor (Research).
-> The selection process includes CBT 1, CBT 2, and Document Verification & Medical Test.
-> The candidates who will be selected will get an approximate salary range between Rs. 13,500 to Rs. 38,425.
-> Attempt RRB JE Free Current Affairs Mock Test here
-> Enhance your preparation with the RRB JE Previous Year Papers.