For this Question: Given an n-digit large number in form of string, check whether it is divisible by 7 or not. Print 1 if divisible by 7, otherwise 0.There is a number num is given in input.

Constraint:
1 ≤ |num| ≤ 10^5Print 1 if num is divisible by 7, otherwise 0.Sample Input:
8955795758

Sample Output:
1, I have written this Solution Code: 
// C++ code to check divisibility of a
// given large number by 7
#include<bits/stdc++.h>
using namespace std;

int isdivisible7(string num)
{
    int n = num.length(), gSum=0;
    if (n == 0)
        return 1;

    // Append required 0s at the beginning.
    if (n % 3 == 1) {
        num="00" + num;
        n += 2;
    }
    else if (n % 3 == 2) {
        num= "0" + num;
        n++;
    }

    // add digits in group of three in gSum
    int i, GSum = 0, p = 1;
    for (i = n - 1; i >= 0; i--) {

        // group saves 3-digit group
        int group = 0;
        group += num[i--] - '0';
        group += (num[i--] - '0') * 10;
        group += (num[i] - '0') * 100;

        gSum = gSum + group * p;

        // generate alternate series of plus
        // and minus
        p *= (-1);
    }

    return (gSum % 7 == 0);
}

// Driver code
int main()
{
    // Driver method
    string num;
    cin>>num;
    if (isdivisible7(num))
        cout << "1";
    else
        cout << "0";
    return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?