Fundamentals of C

  • First, we will discuss about the structure of a basic program in C:

#include<stdio.h>
#include<conio.h>
int main()
{
printf(“Welcome to prequelcoding.in);
getch();
return 0;

}

Let us discuss about each of the terminologies used above.

1. #include(pound sign include) – “#” is a pre-processor which is used to feed some data to the program we are performing, “include” statement will take in all the files or documents of the program.

2. “stdio” – stands for Standard Input And Output, .h is a header file directory where the compiler stores the desired file which we want to implement.

3. “conio” – stands for Console Input And Output which is used to perform mathematical calculations, and .h is a header file by implementing it gives you the desired output.

4. int main() – The main program begins with the statement int main if we are not going to implement this statement then the compiler shows us error that the “error: expected identifier or ‘(’ before ‘{’ token {” .

5. { } – This symbols are called as Parenthesis or Curly Braces, where our entire code is enclosed or stored if you are not going to implement them then your compiler shows you error “expected declaration specifiers before ‘}’ token } this is the error you are going to face if you forget to implement the braces.

6. printf – Printf stands for print function which will display or print the desired line expected in the output. For the input we use a function called scanf which stands for scan function which will take the input or address where our output is implemented.

7. getch(); – Getch(); is used for holding or pausing a program we perform after compiling the code.

8. return 0; – It is a function used to indicate that our code is completed and 0 is an integral value which can be replaced by any integral positive value.

9. ; – This symbol is called semicolon symbol which plays a very important role. It is used to indicate the compiler that the code in the line is completed. If you are not implementing it then you will face the following issue: error: expected ‘;’ before ‘return’….


*** Point to be noted****** – Even a small mistake performed while writing a code will not let the code successfully compile and in turn shows us error. So, one, must be very careful while writing codes.

Scroll to top