c++ - Enter two integer and display the largest number using predefined function -


i type function can't output. can me. must use predefined function. program running have errors please me.

#include <iostream> using namespace std;  float largenum (float a, float b) {     float largenum;     if(a>b)     cout<<"a larger";     if(b>a)     cout<<"b larger";      return (largenum); }  int main() {     float num1, num2;     cout<<"enter number";     cin>>num1;     cout<<"enter number";     cin>>num2;     cout<<largenum<< "is larger"<<endl;     return 0; } 

 #include <iostream> using namespace std;  float largenum (float a, float b) {     if(a>b)          return a;      return b; }  int main() {     float num1, num2;      cout<<"enter number";     cin>>num1;     cout<<"enter number";     cin>>num2;      cout<<largenum(num1, num2)<< "is larger"<<endl;      return 0; } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -