Answer to Question #278478 in C++ for Sahana

Question #278478

Write a program on fault tree analysis for all the common possible circumstances.

1
Expert's answer
2021-12-11T18:45:40-0500
#include <iostream>

using namespace std;

int main()
{
    int a[5] = { 1, 0, 1, 0, 1 };
    int b[5] = { 0, 1, 1, 0, 0 };
    int i, orAnswer;

    for (i = 0; i < 5; i++) {
        if (a[i] + b[i] > 0)
            orAnswer = 1;
        else
            orAnswer = 0;

        cout << endl;
        cout << a[i] << " AND " << b[i] << ' ' << orAnswer << '\n'; 
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog