diff --git a/Day0-HelloWorld/C++/main_kunal.cpp b/Day0-HelloWorld/C++/main_kunal.cpp new file mode 100644 index 0000000..d9a828f --- /dev/null +++ b/Day0-HelloWorld/C++/main_kunal.cpp @@ -0,0 +1,11 @@ +#include + +using namespace std; + +int main() { + string input_string; + getline(cin, input_string); + cout << "Hello, World." << endl; + cout << input_string; + return 0; +} diff --git a/Day4-ClassVsInheritance/Cpp/main.cpp b/Day4-ClassVsInheritance/Cpp/main.cpp new file mode 100644 index 0000000..a5dd115 --- /dev/null +++ b/Day4-ClassVsInheritance/Cpp/main.cpp @@ -0,0 +1,50 @@ +using namespace std; +#include + +class Person{ + public: + int age; + Person(int initialAge); + void amIOld(); + void yearPasses(); + }; + + Person::Person(int initialAge){ + this->age = initialAge; + if(initialAge<0) + cout << "Age is not valid, setting age to 0."<=13 && age <18) + cout << "You are a teenager."<> t; + for(int i=0; i < t; i++) { + cin >> age; + Person p(age); + p.amIOld(); + for(int j=0; j < 3; j++) { + p.yearPasses(); + } + p.amIOld(); + + cout << '\n'; + } + + return 0; +} \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..1885487 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-midnight \ No newline at end of file