void fun1(int i)
{
return i;
}
void fun2(int i)
{
return;
}
25 => printf("\n %d \n",fun1(i));
26 => printf("\n %d \n",fun2(i));
return.c: In function âfun1â:
return.c:6: warning: âreturnâ with a value, in function returning void
return.c: In function âmainâ:
return.c:25: error: invalid use of void expression
return.c:26: error: invalid use of void expression
===========================================
int fun4(int i)
{
return ;
}
int main()
{
int i = 0;
for (i = 0; i<5; i++)
{
printf("\n %d \n",fun4(i));
}
return 0;
}
./a.out
0
1
2
3
4
===============================================