You are not logged in. Please login at www.codechef.com to post your questions!

×

Help understanding this compilation error

#include<stdio.h> void show() { int a[100],b[100],x,y=1,z,m,k,w=0,h,i,t=1,s=0; scanf("%d",&x); for(i=0;i<x;i++) scanf("%d,%d",&a[i],&b[i]); while( y<=x) { z=a[i]; while(z<=b[i]) {k=z; while(k!=0) { h=k/10; k=k%10; if(!(h==4)&&!(h==7)) t=0;} if(t!=0) {k=z; while(k!=0) {k=k%10; s++; } } if(s==4||s==7) w++; z++; } m=w%100000007; printf("\n%d",m); y++; } } ``So I submitted this code for Lucky2 Problem but a compilation error showed up saying:

/usr/lib/gcc/i486-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function _start': (.text+0x18): undefined reference tomain' collect2: error: ld returned 1 exit status

Can anyone plz explain it to me...I mean what have I done wrong here?

asked 24 Jul '14, 20:57

paribhasika's gravatar image

0★paribhasika
11
accept rate: 0%

Corrected my code...n now it says time limit exceeded,optimize it..Anywayz thank you

(24 Jul '14, 21:07) paribhasika0★

It's simple your code does not contain main() function.

link

answered 24 Jul '14, 21:02

achaitanyasai's gravatar image

5★achaitanyasai
2.2k61748
accept rate: 10%

main() Function missing it should be

include<stdio.h>

void main ()
link

answered 21 Aug '14, 18:46

avi_nash's gravatar image

2★avi_nash
381
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×934
×34
×9

question asked: 24 Jul '14, 20:57

question was seen: 821 times

last updated: 21 Aug '14, 18:46