Wednesday, 23 June 2010

C tokens example program

//C tokens example program:

void main()
{
 int a, b, c;
 a = 2, b = 3;
 c = a + b;
 printf(“Addition of two no's = %d \n”, c);
 getch()
}                                                                                                                                                                                                   .
where,

main – function identifier
{,}, (,) – delimiter
int – keyword (data type)
a, b, c – variable identifier
main, {, }, (, ), int, a, b, c – tokens
%d   - is format specifier

You may like the following posts:



No comments:

Post a Comment