Variable is a container to hold data. Datatype of a variable defines the type of data to be stored and the space required to store it. Variables in programming are analogous to variables in algebra. Just as algebraic expressions can have constant terms like ax + by = c , C programs can have constants, defined similar to variables but with the const keyword.
Today we are going to discuss include statements in a C programs. In the last blog of this series we’ve discussed about a function, called printf. We didn’t write the function definition, as it was already present in a file called stdio.h.
The real FUN of functions comes into play when you can build a very complex program by dividing it into smaller functions that do parts of the operations and can be reused in different parts of the program. These utility functions can also be packed together in a file(like stdio.h) and distributed among other developers, to reduce the coding effort of everyone.
Lets now discuss about the ‘function’ part in main() function. As the semester has just started, you may not have been introduced to the concept of functions in programming. In layman terms, a function is a block of code which performs a certain operation. This concept of grouping specific codes to perform some task dates back to early days of development of programming.
For a beginner, their first programming course can be quite intimidating. First of all, the whole computer system seems like a magical thing that can only be made by geniuses, so there is a general perception that computer programmers must be very smart.