new to "C" return question
ok first thanks for helping.
I'm new to programming in general and I decided I'd start with C. I found a pretty sweet tutorial and I'm plugging along but I have a question.
I see in the tutorial that at the end of an "if" block the tutorial has the command "return 0;"
I have written a program below just to kind of get my feet wet and I omitted the "return" line intentionally. It compiles and runs just fine so my question is what does the return line do, do I really need it and how do I use it and it's output later on for better coding?
Thanks again
#include <stdio.h>
int x, y, z;
main()
{
/*get some data here*/
printf("\nEnter a number: ");
scanf("%d", &x);
printf("\n Now enter another number: ");
scanf("%d", &y);
printf("\nYou entered %d, and %d\n", x, y);
/*test values here*/
if (x == y)
printf("%d is equal to %d\n",x,y);
else if (x > y)
printf("%d is greater than %d\n",x,y);
else
printf("%d is less than %d\n",x,y);
}