hello guys , today we are gonna start with our 1st program in C language....we are gonna learn this program in small small parts cause this is your base for the future program so everything should be crystal clear.
soo here's our first program
#include <stdio.h>
#include <conio.h>
void main()
{ clrscr();
printf("hello world");
}
note: C and C++ is the case sensitive language
output:
hello world
to view output screen in turbo IDE we need to press alt+F5
turbo c contain 2 screen blue screen which is code window and other is black screen which is known as console window or output window
in programming language # symbol is know as "poul".Actually unlike any other language in C and C++ our program is first processed by an special software know as pre-processor after that compiler compiles our program.
source code -> pre-processor -> compiler
so now the question is ....what is this pre-processor ???????
so by the word pre-processor we can understand that it is something that starts / perform's its task before any process.IN our program there are some lines with .h extension for example #include<stdio.h> , these file are known as header files . BASICALLY C IDE provides us some preloaded functions or programs using which we can simplify our programs for example clrscr(); is an pre-defined function which comes under conio.h header file
pre-processor replace our header line with pre-defined functions that comes under that header file.we can see that if we compile our program then compiler will show around 400-500 lines compiled but our code is only of 7 lines therefore pre-processor replace lines which start with # with the functions which comes under that header file.so compiler does not deals with header line or the lines containing #include cause pre-processor replace these file with pre-defines functions.
thats all for today , we will discuss about each header files in my next post ....
follow me on twitter @mayank8005
0 comments:
Post a Comment