Friday, January 1, 2021

Java Int to String | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-int-to-string

Solution : 

Java Static Initializer Block | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-static-initializer-block/problem

Solution : 

Java End-of-file | HackerRank | JAVA | Solution



Problem : https://www.hackerrank.com/challenges/java-end-of-file/problem

Solution :

Java Datatypes | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-datatypes/problem

Solution : 

Java Loops II | HackerRank | JAVA | Solution



Problem : https://www.hackerrank.com/challenges/java-loops/problem

Solution :

Java Loops I | HackerRank | JAVA | Solution



Problem : https://www.hackerrank.com/challenges/java-loops-i/problem

Solution :

Java Output Formatting | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-output-formatting/problem

Solution :

Java Stdin and Stdout II | HackerRank | Java | Solution | code the color



Problem : https://www.hackerrank.com/challenges/java-stdin-stdout/problem

Solution :

Overload Operators | HackerRank | C++ | Solution



Problem : https://www.hackerrank.com/challenges/overload-operators/problem

Solution : 

Preprocessor Solution | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/preprocessor-solution/problem

Solution : 

C++ Class Templates | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/c-class-templates/problem

Solution : 

Multi Level Inheritance | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/multi-level-inheritance-cpp/problem

Solution :


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

class Triangle{
    public:
        void triangle(){
            cout<<"I am a triangle\n";
        }
};

class Isosceles : public Triangle{
      public:
          void isosceles(){
            cout<<"I am an isosceles triangle\n";
          }
};

//Write your code here.
class Equilateral : public Isosceles{
public:
void equilateral(){
    cout<<"I am an equilateral triangle\n";
}
}; 

int main(){
  
    Equilateral eqr;
    eqr.equilateral();
    eqr.isosceles();
    eqr.triangle();
    return 0;
}

Rectangle Area | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/rectangle-area/problem

Solution : 

class Rectangle{

    public:

    int width;

    int height;

    void display(){

        cout<<width<<" "<<height<<endl;

    }

};

class RectangleArea : public Rectangle{

    public:

    void read_input(){

        cin>>width>>height;

    }

    void display(){

        cout<<(width*height);

    }

};