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.
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; }
/* * Abstract class: A class which does not contain implementation. * * abstract class must have at least one pure virtual function. * * Pure virtual function: It does not have body. * Syntax: * virtual void function_name(argument_list) = 0; * * C++ is supporting pure virtual destructor as well. However, this * is different from pure virtual function. Because, pure virtual * de s tructor must have function body. * */ #include <iostream> using namespace std; class Animal { public: virtual void run() = 0 ; virtual void speak() = 0 ; // virtual destructor is recommended if there is any // virtual function in a class virtual ~ Animal() { } }; class Dog : public Animal { public: virtual void speak() { cout << "Woof!" << endl; } }; class Labrador : public Dog { public: Labrador() { cout << "New Labrador" << endl; } virtual void run() { cout <...
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++) ...
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