Professional Documents
Culture Documents
Function To Add Tow Binary Number Using Queue Data Structure in
Function To Add Tow Binary Number Using Queue Data Structure in
#include <iostream>
#include <queue>
using namespace std;
if (!num1.empty()) {
bit1 = num1.front();
num1.pop();
}
if (!num2.empty()) {
bit2 = num2.front();
num2.pop();
}
return result;
}
int main() {
string binary1, binary2;
cout << "Enter binary number 1: ";
cin >> binary1;
cout << "Enter binary number 2: ";
cin >> binary2;