Posts

Showing posts from December, 2019

c++ refresh programs

                  c++ refresh programs #include<iostream> using namespace std; class num {  int a,b;  public:  void set(int y,int x)  {   a=y;b=x;  }  void add()  {   cout<<a+b<<endl;  } }; main() {  num obj;  obj.set(2,4);  obj.add(); } NOTE:The above saying that creating absort and making encapulation and accessing throught single interface that is object. #include<iostream> #include<math.h> using namespace std; float absolut(float x) {  return x; } float absolut(double x,float y,float z) {  cout<<"ceil value :"<<x<<" "<<ceil(x)<<endl;  cout<<"floor value :"<<y<<" "<<floor(y)<<endl;  cout<<"abs value :"<<z<<" "<<fabs(z)<<endl;  return ceil(x)+floor(y)+fabs(z); } main() {  cout<<"sa...