Execution of C program
Here we will discuss about the execution of C program step by step.
step1:The line int main() declares the main function.Every C program must have a function named main somewhere in the code.At run time,program execution start at the first line of the main function.In C,the { and } symbols mark beginning and end of a block of code.The line int a,b,c; created three variables(created three memory locations with a address).It help us to store data
step2:Here,the first prompt displayed to the user by using printf statement.The printf statement in C allows you to send output to standard out(for us,the screen).
step3:If you enter a data.It is stored into the memory location "a"."&a" means write data into the location"a".
step4:Here,the second prompt displayed to the user.
step5:And the second data stored into the second memory location "b".
step6:Here,we will used a formula c=a+b; (the value of a+b is stored into "c")
step7:The line "5+4=9" is formed and displayed to the user.
Home Next>>