+ 1

please what s problem in this code

#include <iostream> using namespace std; int larger (int num1 ,int num2 ); int main() { int n1 ,n2 ; cout << " enter 2 numbers \n"; cin >> n1>>n2 ; cout <<"larger is "<<larger (n1,n2)<<"\n"; } int larger (int num1,int num2) { if(num1>num2) return num1; else return num 2; }

31st Mar 2020, 3:19 PM
Mohamed Eiid
Mohamed Eiid - avatar
3 Respostas
+ 3
It should num2 not num 2. The whole code as follows: #include <iostream> using namespace std; int larger (int num1 ,int num2 ); int main() { int n1 ,n2 ; cout << " enter 2 numbers \n"; cin >> n1>>n2 ; cout <<"larger is "<<larger (n1,n2)<<"\n"; } int larger (int num1,int num2) { if(num1>num2) return num1; else return num2; }
31st Mar 2020, 3:27 PM
JaScript
JaScript - avatar
+ 2
thanks it 's run
31st Mar 2020, 3:42 PM
Mohamed Eiid
Mohamed Eiid - avatar
+ 2
Please learn that it is important to read the comments of the debuger 🙃
31st Mar 2020, 3:58 PM
JaScript
JaScript - avatar