1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tom [10]
4 years ago
13

Write the proghrams for the following:

Computers and Technology
1 answer:
belka [17]4 years ago
5 0

Answer:

a)

#include <iostream>

using namespace std;

int main() {

   bool a,b,c;

   cin>>a>>b;

   if(a^b)//X-OR operator in C++.

   c=true;

   else

   c=false;

   cout<<c;

return 0;

}

b)

#include <iostream>

using namespace std;

int main() {

   bool a,b,c,d;

   cin>>a>>b>>c;

   if((a^b)^c)//X-OR operator in C++.

   d=true;

   else

   d=false;

   cout<<d;

return 0;

}

Explanation:

The above written programs are in C++.There is an operator (^) called X-OR operator in C++.It returns true if the number of 1's are odd and returns false if the number of 1's are even.

In the if statement I have user X-OR operator(^) to find the result and storing the result in another boolean variable in both the questions.

You might be interested in
What is the purpose of a macro in a word processor?
Natali [406]
C : to determine error rate
8 0
3 years ago
Read 2 more answers
Describe artificial intelligence, and contrast the human mind and the computer as information processors
marin [14]
Robots can think better than humans can and they also can’t feel emotion like us. Also, unlike humans, they can predict what will happen next
8 0
4 years ago
Complete the following code to display an applet, so that the contents are contained in a rectangle around the phrase "Exercise
sertanlavr [38]

Answer:

//. Program is written in Java Programming Language

// Comments are used for explanatory purpose

// Program starts here

// import required libraries

import java.swing.JApplet;

import java.awt.*;

// Declare class as

public class DrawGraphics extends JApplet

{

//.Assume the following values for width, height and area of the shape

final int area= 150 ;

final int width = 100, height = 50;

{

//Draw a Rectangle around the applet's display area starting from 5,15

g.drawRect( 5,15, area-1, area-1 );

//Draw the current string inside the rectangle

g.drawRect( area/2 - width/2 , area/2 - height/2, width, height );

}

}

7 0
3 years ago
Write the line of Python code that calculates and prints the answer to the following arithmetic expressions.
love history [14]

Answer:

Explanation:

If the chosen programming language for this is Python and you only want the code to calculate the expression and print it then these are the following codes

a.   print(5**3)

b.  print((4+6) * (34 / 5))

Each one of these lines of code will calculate the arithmetic expressions and print the answer to the screen.

8 0
3 years ago
Should spreadsheets be used to track time worked at a job?<br><br> YES<br> NO
drek231 [11]

Answer:

Yes

Explanation:

Spreadsheets should be used to track time worked at a job because it would make it easier to use and see rather than another platform.

8 0
2 years ago
Other questions:
  • What was the treaty of the Meter
    13·1 answer
  • How to write equal to or greater than in word?
    9·1 answer
  • Ask me anything about grades kindergarten to fifth grade!
    12·1 answer
  • To maintain her audience's confidence in her, what should kiara not do while delivering her presentation?
    6·2 answers
  • The purpose of a function that returns "void" is:_________. A) To satisfy compiler warnings B) To package a repeated task as a f
    7·1 answer
  • Write a c++ program that generates three random numbers. The first number should be between 0-30, the second number should be be
    7·1 answer
  • there are these numbers that I've seen before but I don't know what they mean can someone help. I will give brainiest
    8·2 answers
  • What is a leased line​
    12·2 answers
  • Assume you're using a three button mouse.To access shortcut menus,you would
    10·1 answer
  • Completar Fill in the blanks with the correct familiar commands. dar (negative) 1 of 1 Question 2 with 1 blank hacer (affirmativ
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!