why we use function declaration and when we use it And why we don't use in the below example.

+1 vote
asked Sep 2, 2019 by anonymous
main()
{
while(fun());
getch();
}
int fun()
{
static int x=4;
printf("%d",x);
return(--x);
}

1 Answer

0 votes
answered Sep 17, 2019 by (260 points)
The function "fun()" return type is int, so function declaration is not necessary.
As by default function returns integer. If a function returns other than integer it should be declared
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...