Problem 195. Program an exclusive OR operation with logical operators
57.24% Correct | 42.76% Incorrect
Last Solution submitted on Feb 15, 2023
A C on 20 Jul 2018
Can you show me how to write an if statement for this?
I have it in my code. It will not work for the last test.
% this if statement would not work with a=[0 0 1 1];b=[1 0 1 0];.
%if (a==0 & b~=0) || (b==0 & a~=0)
%i = 1;
%i = 0;
%y = i;
Varoujan on 3 Jun 2015
Problem statement was not specific and didn't indicate the inputs a, b could be vectors.
Richard on 1 Mar 2013
Sorry, I just wondered if xor was somehow restricted on this cody . . . I guess not.
Problem Recent Solvers691
07 - Common functions and indexing 5
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!