A function prototype tells the compiler what kind of arguments a function is looking to receive and what
kind of return value a function is going to give back. This approach helps the compiler ensure that calls to a function are made correctly and that no erroneous type conversions are taking place.
main() is the user defined function.
main() is the first function in the program which gets called when the program executes.The startup code contains runmain() function which calls main() function.we can’t chage the name of the main() function.
Random() returns a random number between 0 and (num-1).random(num) is a macro defined in stdlib.h
Randomize() initializes the random number generator with a random value.Because randomize is implemented as a macro that calls the time function protyped in time.h,you should include time.h when you use this routine.
Both are similar but a normal diffrence is that printf() print the actual means which we want to print and sprint() is for only string operation
Before using these functions <math.h>
should be included in the program
sin(d) will returns the sine of d,
pow(a,b) will returns a the value a to the power b(a^b)
eg:pow(2,3) will returns 8;
sqrt(a) returns the square root of a
eg: sqrt(4) returns 2;
int main(int argc,char *argv)
while((c=getc(fp)) != EOF)
A large program is subdivided into a number of smaller programs or subprograms. Each subprogram specifies one or more actions to be performed for a large program.such subprograms are functions.
The function supports only static and extern storage classes.By default, function assumes extern storage class.functions have global scope. Only register or auto storage class is allowed in the function parameters. Built-in functions that predefined and supplied along with the compiler are known as built-in functions.They are also known as library functions.
It generally depends on your requirement. Because macro are inserted into the code where they called and the cursor always go sequentially. It means, when a compiler compile the program, it insert the macro code to particular place. And it increases the speed of execution.But in case of function, whenever it is called the pointer goes to particular address where function is stored and do calculation and return result if required.
In this case, if a function is called so many time, it consume time in to and from.