Language: C++

#include<bits/stdc++.h>
using namespace std;
void prime() {
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (int i = 3; i*i <=x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}
int main() {
    int x;
	while (cin>>x) {
	    prime();
	    if(!x)return 0;
		for(int i=x; i>=13; i--){
			if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
			    cout<<i<<endl;
              	break;
            }
        }
    }
  	 return 0;
}






Compiler output:
a.cc: In function 'void prime()':
a.cc:4:13: error: 'x' was not declared in this scope
    4 |         if (x < 2)return 0;
      |             ^
a.cc:4:26: error: return-statement with a value, in function returning 'void' [-fpermissive]
    4 |         if (x < 2)return 0;
      |                          ^
a.cc:5:33: error: return-statement with a value, in function returning 'void' [-fpermissive]
    5 |         else if (x == 2) return 1;
      |                                 ^
a.cc:6:13: error: 'x' was not declared in this scope
    6 |         if (x % 2 == 0) return 0;
      |             ^
a.cc:6:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
    6 |         if (x % 2 == 0) return 0;
      |                                ^
a.cc:7:31: error: 'x' was not declared in this scope
    7 |         for (int i = 3; i*i <=x; i += 2) {
      |                               ^
a.cc:8:38: error: return-statement with a value, in function returning 'void' [-fpermissive]
    8 |                 if (x%i == 0) return 0;
      |                                      ^
a.cc:10:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   10 |         return 1;
      |                ^
a.cc: In function 'int main()':
a.cc:18:34: error: too many arguments to function 'void prime()'
   18 |                         if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
      |                             ~~~~~^~~
a.cc:3:6: note: declared here
    3 | void prime() {
      |      ^~~~~
a.cc:18:46: error: too many arguments to function 'void prime()'
   18 |                         if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
      |                                         ~~~~~^~~~~~~
a.cc:3:6: note: declared here
    3 | void prime() {
      |      ^~~~~
a.cc:18:34: error: could not convert 'prime()' from 'void' to 'bool'
   18 |                         if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
      |                             ~~~~~^~~
a.cc:18:46: error: could not convert 'prime()' from 'void' to 'bool'
   18 |                         if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
      |                                         ~~~~~^~~~~~~
a.cc:18:62: error: too many arguments to function 'void prime()'
   18 |                         if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
      |                                                         ~~~~~^~~~~~~
a.cc:3:6: note: declared here
    3 | void prime() {
      |      ^~~~~
a.cc:18:78: error: too many arguments to function 'void prime()'
   18 |                         if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
      |                                                                         ~~~~~^~~~~~~
a.cc:3:6: note: declared here
    3 | void prime() {
      |      ^~~~~