hello world


Hey yo ,if you are new to programming you have landed at good  site , without anything further  lets start with programming in C



where ever you go you will wonder what thing is written  and what does it do and what does it mean?







Thats why im here to tell you about that program ,hope you know its called a  program(😅😅),just kidding

---On line no 3 you would see #include<stdio.h>


the # symbol signifies that what comes after it is a preprocessor in this case it is (include)
and  stdio.h is a ( header file ) and (< ,>) is the syntax (the way it is written)

actually before your program gives the output there are 4 stages from which your program goes 

1 . preprocessing
2 . compilation   
3. assembler     
4. linking


so in preprocessing all the preprocessor are included in your program ,in compilation there is a check that is there is any syntax error or not and convert the high level language to assembly level ,and assembler convert assembly level to machine code(which computer can understan) and in linking all the .lib files are merged all in one source code .


 *  now you will question what is header file ?


-a header file is a file which include many inbuilt functions (which performs specified task)
so in order to use them you have to include them in you program ,here printf is a function whose code is written in  stdio  header file  ,which print the specified thing in double quotes (" some text") on your ouput console (monitor) 



which would look like this..



--on line 5 you will see int main()




int basically signifies the return type of the function and main is the name of function from where the execution of your program begins and in between the brackets we write the arguments in this case it is void (you can write void or leave it empty means the same)


--on line you would see return 0 ;





here we are returning 0return is a keyword which is used to return some value from a function. It indicates that our program has been run successfully and we terminate our main function with this return statement.
(you can also write a void as a return type of a function and return nothing that would also work) 





*you would have wonder why there is a semicolon at the end line ?

  it just tells the end of line or it is a syntax in which you basically end the line (there would be no semicolon in function definition and in the preprocessor  used


and { } signifies the starting and ending of a function .


 (leave the comment down below if you have a doubt or suggestions ,thnks🙂)


No comments:

Post a Comment

Contact Form

Name

Email *

Message *