Originally Posted by shabbir
Offtopic comment:
I have added the code blocks

There are 2 ways your problem can be solved.

1. Define sumprod(int x,int y,int z) above the main.
2. Have the function declaration (prototype) above the main and then have the function definition where you are having it right now.

ok ok now i get it,
1. is the ANSI style
2. the K&R style