Answer to Question #20905 in C++ for ritimukta mohapatra
write a c++ program to addition of two number in which member function definition outside the class
1
2012-12-20T07:37:03-0500
#include <iostream>
#include <conio.h>
#include <time.h>
using namespace std;
class Number{
public:
int number;
};
//main function
int main()
{
Number num1;
Number num2;
num1.number=50;
num2.number=100;
int sum=0;
sum=num1.number+ num2.number;
cout<<sum;
getch();
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment