- #1
transgalactic
- 1,395
- 0
how to solve this bug??
when i run this code
instead of getting some expected out put i get
line 17: `main' must return `int'
but main is a void function
it can't return int
?
when i run this code
instead of getting some expected out put i get
line 17: `main' must return `int'
but main is a void function
it can't return int
?
Code:
#include <stdio.h>
int a(int n,int count){
int i;
for(i=0;i<n;i++)
count =a(i,count);
return count+1;
}
int b(int n,int count) {
int i;
count =a(n,count);
for(i=0;i<n;i++)
count =b(i,count);
return count;
}
void main (){
int i;
for (i=0;i<4;i++)
printf("%d",a(i,0));
printf("\n%d\n",a(i,10));
for (i=0;i<4;i++)
printf("%d",b(i,0));
printf("\n%d\n",b(i,10));
}