Basic C Program
===========
C is a high-level language (language which is understandable to humans to communicate with machine) which lies between assembly language and high-level language.
It is mainly a procedural programming language that makes user (or programmer) to program using the specified functions buit-in its predefined library. It also provides the feature to create user-defined functions (functiins created by user/programmer with his/her own choice).
Lets have a look at the basic C-program.
#include <stdio.h> //pre-processor directory
int main( ) //defining main() function
{
printf("IT IS FIRST C-PROGRAM AT ITKNOWLEDGE");
return 0;
}
OUTPUT :-
Every C-program starts its execution with the function main() and the compilation process starts with the preprocessor directives (i.e. #include ...). We shall use here Borlands Turbo C++ (now outdated) for programming in C ,which is free to download and provides IDE(Integrated Development Environment)facility, which is a compiler, not interpreter.
#include <>
Every preprocessor deirective has the above format for using the header files. Each header file has functions defined in it to use in the program irrespective of defining them too.
printf("")
Every function has been defined in its preprocessor directory. printf() has been defined under <stdio.h> header file. This function let the user to print desired message(s) to the console monitor (at the display during running of program). Anything written in it is just displayed as it is. Like if we would have written the command as:-
printf("I'M LEARNING THROUGH ITK SITE");
It will give the OUTPUT as:-
OUTPUT.
This isn't any function or keyword for C-programming. It actually means the result that will be shown at the screen after the execution of program.
C-language defines its statement till semi-colon( ; ) appears.
Codes in C-programming can be written in as single-line code. As the above code could be written as:-
#include <stdio.h> int main( ){printf("IT IS FIRST C-PROGRAM AT ITKNOWLEDGE");return 0;}
It doesnot affect the OUTPUT of the program. All you have to be careful about is its syntax.
Basically, C-language is now outdated programming language, but is good to clear the basics and create the mindset towards programming languages. It has emminent feature that let us to clearify our logic to code in specific situation.
Regards,
ITK
===========
C is a high-level language (language which is understandable to humans to communicate with machine) which lies between assembly language and high-level language.
It is mainly a procedural programming language that makes user (or programmer) to program using the specified functions buit-in its predefined library. It also provides the feature to create user-defined functions (functiins created by user/programmer with his/her own choice).
Lets have a look at the basic C-program.
#include <stdio.h> //pre-processor directory
int main( ) //defining main() function
{
printf("IT IS FIRST C-PROGRAM AT ITKNOWLEDGE");
return 0;
}
OUTPUT :-
And the program will look in Turbo C++ like :-
Every C-program starts its execution with the function main() and the compilation process starts with the preprocessor directives (i.e. #include ...). We shall use here Borlands Turbo C++ (now outdated) for programming in C ,which is free to download and provides IDE(Integrated Development Environment)facility, which is a compiler, not interpreter.
#include <>
Every preprocessor deirective has the above format for using the header files. Each header file has functions defined in it to use in the program irrespective of defining them too.
printf("")
Every function has been defined in its preprocessor directory. printf() has been defined under <stdio.h> header file. This function let the user to print desired message(s) to the console monitor (at the display during running of program). Anything written in it is just displayed as it is. Like if we would have written the command as:-
printf("I'M LEARNING THROUGH ITK SITE");
It will give the OUTPUT as:-
OUTPUT.
This isn't any function or keyword for C-programming. It actually means the result that will be shown at the screen after the execution of program.
C-language defines its statement till semi-colon( ; ) appears.
Codes in C-programming can be written in as single-line code. As the above code could be written as:-
#include <stdio.h> int main( ){printf("IT IS FIRST C-PROGRAM AT ITKNOWLEDGE");return 0;}
It doesnot affect the OUTPUT of the program. All you have to be careful about is its syntax.
Basically, C-language is now outdated programming language, but is good to clear the basics and create the mindset towards programming languages. It has emminent feature that let us to clearify our logic to code in specific situation.
Regards,
ITK
Comments
Post a Comment