0
Why is it showing 'time limit exceeded' when i run a program in c?
I made a small program of addition by calling a function in c..but there's no output and its showing 'time limit exceeded'. Why is it so and what's the solution to this? Since I m new , m not getting it.. please help.
4 Answers
+ 3
#include <stdio.h>
int sum(int,int);
void main()
{
int s,a,b;
a=1;
b=5;
s=sum(a,b);
printf("sum = %d",s);
}
int sum(int x, int y)
{
int c;
c=x+y;
return c;
}
The above code works fine, now. The problems were:
1. placing function prototype inside the main block.
2. Using obsolete getch() function which belongs to conio.h library (main source of the problem)
+ 3
Please attach your problematic code to the post to get more out of your query.
That's nearly impossible to tell exactly what is the source of the problem without seeing the actual code.
+ 1
+ 1
oh, got it đ
Tnk u so muchđđ C++ Soldier (Babak)