Write a program on fault tree analysis for all the common possible circumstances.
#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';
}
}
Comments
Leave a comment