Why do i get a compile error?

code chef uses certain set of compiler for assessment…
try to use the same on your machine…
there is difference between how you write code in turbo c++ and gcc compiler

1 Like

instead of conio.h which library should i use???

1 Like

while submitting the code … we are getting wrong answer as an error even though it is compiling and giving the output in the codechef compiler.

Well Basically Compilation Error Occurs When You Dont Follow The Syntax Which Is Used While Coding
Like Skipping The ‘;’ or forgetting to close the } or if u make the incorrect for construct and many more times.

Also Do Check If You Have Selected The Correct Language In The Submission Page As Sometimes In A Hurry We Often Chose The Wrong Language.

prog.c:2:18: fatal error: conio.h: No such file or directory

#include < conio.h >

compilation terminated


I encountered the above compilation error… Whats the problem?

@depanshushani , don’t use it at all. Use only <stdio.h>. Codechef doesn’t use Turbo C compiler. :slight_smile:

1 Like

@kunnu27
I use CodeBlocks. It is Best. You can download it and code here.

And I suggest you to code on codechef online IDE.

1 Like

My code works fine on codeblocks and codechef IDE still I get compile time error. Can someone help me out.

My code works fine on codeblocks and codechef IDE still I get compile time error. Can someone help me out.

If code blocks is such a compiler ?

My programs ran successfully in code blocks .
conio.h is not used in my program .
Time doesn’t exceeded .
In codeblocks my program gave right output .
Then why my answer is shown as wrong in codechef ?

1 Like

I am trying to run my program written fir solving the problem “Fake Binary Search” as a part of “May challenge 2018 DivB” but I am getting a strange compilation error for my JAVA code. Firstly, the program takes almost 40 minutes to run and the ide says “Submission Queued”. After completion, I get the following compilation error:

## Not Found

The resource could not be found.

Please help me someone. I am facing this strange issue first time. Is this a fault of mine or the codechef server has a problem?

I am trying to run my program written fir solving the problem “Fake Binary Search” as a part of “May challenge 2018 DivB” but I am getting a strange compilation error for my JAVA code. Firstly, the program takes almost 40 minutes to run and the ide says “Submission Queued”. After completion, I get the following compilation error:

## Not Found

The resource could not be found.

Please help me someone. I am facing this strange issue first time. Is this a fault of mine or the codechef server has a problem?

Hello.
So the following the code which works absolutely fine in netbeans but when I upload on CODECHEF, it shows COMPILATION ERROR. Plz help.

import java.util.Scanner;
public class Main {

public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int l,b;
System.out.println("Enter length and breadth: ");
l=in.nextInt();
b=in.nextInt();
float area, peri;
area = l*b;
peri = 2*(l+b);
if(area>peri){
    System.out.println("Area");
    System.out.println("Area="+area);
}
else
    System.out.println("Perimeter");
System.out.println("Perimeter"+peri);

}
}

1 Like

Yes. Sometimes output of codeblocks and codechef do differ- but ultimately thats due to some fault in your code which codeblocks ignores but codechef doesnt.

It has been the same for everyone for more than 1 hour. There are some problems with codechef submission. Admin, please fix this issue asap.

Hello everyone, I am new to programming the issue which I am facing is like when I run the code on codechef IDE it gives the result of “Successfully Executed” but when I try to Submit it it gives me Compilation error.

Below is my code:

import java.util.;
import java.lang.
;
import java.io.*;

class Question_A{

    public static void main(String[] args) throws IOException
    {
       try {
    	   int number;
	        Scanner sc = new Scanner(System.in);
	        
	        number = sc.nextInt();
	          while(number != 42)
	          {
	              System.out.println(number);
	              number = sc.nextInt();
	          }
	          
       }
	          catch(Exception e){
	        	  
	          } 
	       
       }
    }

Please help me

While submitting i got the compile time error why so.
/* package codechef; // don’t place package name! */

import java.util.;
import java.lang.
;
import java.io.;
import java.util.Scanner.
;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here

	int rs,prs,brs,t;
	
Scanner s = new Scanner(System.in);
t=s.nextInt();

	if(0<t)
	{
	    if(t<101){
	        
	    	rs=		s.nextInt();
	prs=	s.nextInt();
	brs=		s.nextInt();
	if(rs>=prs)
	System.out.println("He can eat pizza");
	
	else if(prs>rs)
	{
	    if(rs>brs)
	    {
	        System.out.println("He can not buy a PIZZA but can buy a BURGER for his dinner.");
	    
	}
	
	else
	System.out.println("he can not buy anything and remains hungry :");
	}}
}

}

You can use online compiler for better result or you can use Vs code editor for better experience …

use EditPlus as another alternative for all languages, it is same as Turbo not allowing any type of predefined or anything. It is the best platform for beginners to gain all knowledge and not get habituated to pre-made foods.