the program explains itself
can someone prof read this for me..
#include <iostream>
# include <string>
#include <iomanip>
using namespace std;
int var1,var2;
int* ptr;
int main () { // main driver function
cout << "enter one number";
cin >> var1;
cout << "enter another number";
cin >> var2;
if (var1>var2)
{
ptr=&var1;
cout << *ptr << "this is the big one";
}
else (var1<var2);
{
ptr=&var2;
cout << *ptr << "this is the big one";
}
system("pause");
return 0;
}
basically the problem says write a complete C++ program that has a main function, an ask for two numbers function, which asks the user for two integers. these two integers are "returned" to main and are then sent to find big one. it returns the larger value to main
also if you put the second number lower it will return both any advice on how to fix it
#include "the big one.h"
#include <iostream>
# include <string>
#include <iomanip>
using namespace std;
int var1,var2,q, w;
int* ptr;
int main () { // main driver function
cout << "enter one number";
cin >> q;
cout << "enter another number";
cin >> w;
if (q>w){ //function definition
ptr=&q;
cout << *ptr << "this is the big one";
}
else(q<w); {
"this is not the big one";
}
else if(w>q) {
ptr=&w;
cout << *ptr << "this is the big one";
}
#include <iostream>
# include <string>
#include <iomanip>
using namespace std;
int var1,var2,q, w;
int* ptr;
int main () { // main driver function
cout << "enter one number";
cin >> q;
cout << "enter another number";
cin >> w;
if (q>w){ //function definition
ptr=&q;
cout << *ptr << "this is the big one";
}
else if(w>q) {
ptr=&w;
cout << *ptr << "this is the big one";
}
else(q==w); {
"this is not the big one";
}