C-Programming
C is a programming language designed by ‘DENNIES RITCHIE’ at AT& T Bell Labs in USA in 1972. The C programming Language is basically mother of all the languages. It is a powerful language. It is middle level language because it combines of best features of high level language with the control and flexibility of low level language and its also a function oriented. It is a powerful system programing language because of the access it provides to the addresses where variables are stored distinguishing C from programming like FORTRAN and COBOL.
CHARACTER SET--
. (Period) $ (Doller) > (Greater Than)
; (Semi colon) # (Hash) = (Equal to)
: (Colon) % (Percentage) | (Vertical Bar)
? (Question Mark) & (Ampersand)
‘ (Apostrophe) [ ] (Index Brackets)
“ (Quotation Mark) { } (Braces)
_ (Underscore) + (Plus)
( ) (Paranthesis) - (Minus)
/ (Slash) * (Asterisk)
Token
- Keywords
- Identifiers
- Operators
- Constant
- Strings Constant
- Special Symbol
Counting of Tokens:--
- int is a keyword--1
- a,b and c are variables--3
- ; is a delimiter--1
- comma(,) is a separator--2
- printf is a function--1
- 10,20 is a interger constant--2
- ; is a delimiter--1
- "%d%d" is a string constant--1
- comma(,) is a separator--2
- comma(,) is a operator--2 (because this comes inside the printf function so it work both as a operator and as a separator )
- d is a variable--1
- 'A' is a string constant--1
- 10,2,34 are integer constant--3
- =,+,-,/ are operators--4
- ; is a delimiter--1
#include<studio.h>
output:----
Hello C
Compilation and Execution
- Compilation is a process in which your input source program is checked for any syntactical or syntax errors like missing semicolons(:), comma(,), operators, wrong expression, wrong use of operators etc.
- If everything is ok then compiler generates an .obj file(contains object code),and one more file with the extension .bak (contain backup code for object)
- The compiler generate file .obj is passed to the linker who does the job of linking the necessary file to your program and generates an .exe version of your program which you can run by simply typing typing the file name in command prompt.
- When you press ctrl+F9, 3 files are generated, .obj, .bak and .exe
Comments
Post a Comment