No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I need to do 2x2 array calculation.but not using global variable. enterData() calculate() displayResult() this are the three function. but i can't pass the value.. please help me.. I've done it without using function.. #include <iostream> using namespace std; calculate(int x[][],int y[][]); enterData() { int x[2][2]; int y[2][2]; int t[2][2]; … |
|
#include <iostream> using namespace std; int main () { int R,G,Y; int r,g,y; int a; cout<<"enter your input"<<endl; cin>>a; if (a==R||r) { cout<<"please stop"<<endl; } else if (a==G||g) { cout<<"you can go"<<endl; } else if (a==Y||y) { cout<<"prepare to stop"<<endl; } else cout<<"Out of range"<<endl; return 0; } |