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
Debora [2.8K]
3 years ago
5

In this recitation assignment, will write a complete C program that accepts as input any two integers from the user and swaps bo

th integers using bitwise operators only without a third variable. E
Computers and Technology
1 answer:
katovenus [111]3 years ago
6 0

Answer:

#include<iostream>

using namespace std;

int main()

{int num1,num2;

cout<<"enter 2 numbers:"<<endl;

cinn>>num1;

cinn>>num2;

cout<<("value without swapping of num1",num1);

cout<<("value without swapping of num2",num2);

 num1 ^= num2;

   num2 ^= num1;

   num1 ^= num2;

cout<<("num1 after swapping",num1);

cout<<("num2 after swapping,num2);

return 0;

}

You might be interested in
How to fix 500 internal server error youtube?
DedPeter [7]
Just shut everything down.

Hope this was helpful :) 
5 0
3 years ago
Read 2 more answers
You downloaded a picture that a friend sent you on social media, but when you opened it, you noticed that another unfamiliar pro
solmaris [256]

Answer:

Malware.

Explanation:

3 0
3 years ago
An array name and index are separated using ____.
Gre4nikov [31]

The answer is Square Brackets.  <span><span>An array name and index are separated using Square Brackets.  They are </span>are mainly used to enclose words added by someone other than the original writer or speaker, typically in order to clarify the situation.  </span>


7 0
3 years ago
Given a Scanner reference variable named input that has been associated with an input source consisting of a sequence of strings
Usimov [2.4K]

Answer:

// Program segment is written in Java programming language

// Comments are used for explanatory purpose

// Program segment starts here

// Initialise the two in variable to 0

count = 0;

longest =0;

// define the string variable

String myString = new String();

// Check if scanner reference contains string using while iteration

while (input.hasNext()){

// Input string while condition is true

myString = input.next();

// Compare length of string with longest variable

if (myString.length() == longest)

{

// If equal, increment count by 1

count++;

}

// If length of string is greater than longest

else

if (myString.length() > longest)

{

longest = myString.length(); // assign length of string to longest

count = 1; // set count to 1

}

}

// End of code segment

6 0
3 years ago
Read 2 more answers
Solve the expression 4*3/ (5+2) 7%4
oksian1 [2.3K]

Answer:

36/7

Explanation:

First, multiply 4 and 3 then add 5 and 2 the answer you will get is 12/7, and then calculate 7%4 answers you will get is 3 now multiply 12/7 and 3 your answer will be 36/7

3 0
2 years ago
Other questions:
  • How do I delete a class on Edulastic?
    8·2 answers
  • A _____ is a computer network that connects computers within a school.
    13·1 answer
  • Which features can Danica use to fix the issue
    5·1 answer
  • You can use any of the ____ comparison operators to control a loop.
    9·1 answer
  • Iwhen using excel when is the best time to use the add paste special function ?
    10·1 answer
  • Which note taking strategy has you divide a page into 3 sections for your notes, key points, and summary?
    11·1 answer
  • HELP PLEASE!!!
    7·1 answer
  • D Question 9 What is output by the following?
    5·1 answer
  • Which of the following items can you locate in a document using the navigation pane? Choose the answer.
    10·1 answer
  • 1. Give one reason why data is represented in binary in a computer [1]
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!