OOP Assignments , Linux commands , C++ Algorithms , Programming concepts , Best Algorithms , C++ Projects , Latest Computer Tools , Ethical Hacking , Hacking , Computer secrets , search for any thing you need related to computer.
The best coding tool
Get link
Facebook
X
Pinterest
Email
Other Apps
Notepad++ is one of the best tool for coding it makes coding easier by adding different colors to the text.
windows 10 activator 2020 is the best and most searchable computer program in order to permanently activate your windows 10 product key for a lifetime. In extension to it’s easy to use and does not need the practice to bring the activation keys to use when deciding to activate the program.
Following is the code that will help you in the assignment for the addition of the arrays using operator overloading and returning an object. #include<iostream> using namespace std; int num; struct add { int ar[20]; }; add operator+(add &a1,add &a2) { add a3; for(int i=0;i<num;i++) a3.ar[i]=a2.ar[i]+a1.ar[i]; return a3; } int main() { add a1,a2,a3; cout<<"How many elements to be stored (max 20) : "; cin>>num; cout<<"Enter elements of array a1 : "; for(int i=0;i<num;i++) cin>>a1.ar[i]; cout<<"Enter elements of array a2 : "; for(int i=0;i<num;i++) cin>>a2.ar[i]; a3=a1+a2; cout<<"Addition of two arrays : "; for(int i=0;i<num;i++) ...
Here is the way you can find the square root of any number by writing your own code in c++. #include<iostream> using namespace std; double sqrt(double num){ double stop_condition = 0.00000001; double guess = num/2; while((guess-num/guess) > stop_condition){ guess = (guess+num/2)/2; } return guess; } int main(){ double num = 4; cout<<"The result is: "<<sqrt(num)<<endl; return 0; }
#include <iostream> using namespace std ; class position { public: int x ; int y ; position (){ x = 0 ; y = 0 ; } position operator + ( position & p_any ){ position p1 ; p1 . x = this -> x + p_any . x ; p1 . y = this -> y + p_any . y ; return p1 ; } }; int main (){ position p1 ; cout<< "Enter the intial values of x and y cordinates: " ; cin>> p1 . x >> p1 . y ; position p2 ; cout<< "Enter the new values for x and y to be shifted: " ; cin>> p2 . x >> p2 . y ; position p3 ; p3 = p1 + p2 ; cout<< "The initial values were: " << p1 . x << " " << p1 . y <<endl; cout<< "The new values are: " << p3 . x << " " << p3 . y <<endl; } // from now onward this is the second task #in...
windows 10 activator 2020 is the best and most searchable computer program in order to permanently activate your windows 10 product key for a lifetime. In extension to it’s easy to use and does not need the practice to bring the activation keys to use when deciding to activate the program.
ReplyDelete