The need:
This is program is just to print "Hello World !" on the standard output using User defined function.
--------------------------------------------
#include<stdio.h>
void print_hello(void); //declaration of function
int main()
{
print_hello();
return 0;
}
void print_hello(void) //definition of function
{
printf("Hello World!\n");
}
--------------------------------------------
The approach:
First of all copy, paste, compile and run the program. After that try to understand the code and also try to compare with code of program1 of this blog.
The approach:
First of all copy, paste, compile and run the program. After that try to understand the code and also try to compare with code of program1 of this blog.
Remarks:
There are 2 noticeable points.
1. The output of both the programs is same.
2. The only difference is in the code (that is in this I have used UDF.)
No comments:
Post a Comment
feel free to ask your doubts... if any
you can post your doubts on
www.facebook.com/programsimply