back AGAIN idk why this is not working im doing this from watch a video step by step and some how it driving me nut and i know im missing 1 little thing but i cant find it if u have time mind helping me now in the erro prompt below it say number was not declared but it was in the 'Sqr' function just dont know and if i put 'Public int Sqr' it get worst
usingnamespace std;
int Sqr(int number){
int squ = number * number;
return squ;
}
int main(){
int num;
cout << "Enter A Number : ";
cin >> num;
cout << endl;
cout << num << " square = " << Sqr(number) << endl;
return 0;
}
and the error code is:
||=== Build: Debug in TheWorld2 (compiler: GNU GCC Compiler) ===|
C:\Users\Michael\Desktop\TheWorld2\main.cpp||In function 'int main()':|
C:\Users\Michael\Desktop\TheWorld2\main.cpp|22|error: 'number' was not declared in this scope|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|