[go: up one dir, main page]

0% found this document useful (0 votes)
86 views3 pages

Character Set and Keywords: Programming in C

C programming consists of basic elements like character set, keywords, data types, variables, arrays, and statements. The C character set includes uppercase and lowercase letters, digits, and special characters like + and - which are used to form program elements. Identifiers are names given to variables, functions, and arrays, and must start with a letter but can include letters, digits, and underscores. Keywords are reserved words in C like if, else, while that have predefined meanings and cannot be used as identifiers.

Uploaded by

Swapnil Sonar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views3 pages

Character Set and Keywords: Programming in C

C programming consists of basic elements like character set, keywords, data types, variables, arrays, and statements. The C character set includes uppercase and lowercase letters, digits, and special characters like + and - which are used to form program elements. Identifiers are names given to variables, functions, and arrays, and must start with a letter but can include letters, digits, and underscores. Keywords are reserved words in C like if, else, while that have predefined meanings and cannot be used as identifiers.

Uploaded by

Swapnil Sonar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Programming in C

Character set and Keywords


By Prof. S.M. Sonar (BE Computer) Introduction C language consists of some basic elements which are used to construct simple C statements. These elements include the C character set, identifiers, and keywords, data types, constants, variables and arrays, declaration, expressions and statements. We will see how these basic elements can be combined to form more comprehensive program components. The C character set C uses the uppercase letter A to Z, the lowercase letters a to z, the digits 0 to 9, and certain special characters as building blocks to form basic program elements ( e.g., constants, variables, operators, expressions, etc.). Some of the special characters are listed below: + - * ~ % / & ( ) { } [ ] ? " < > ! ; :

Most versions of the language also allow certain other characters, such as @ and $, to be included within strings and comments. C uses certain combinations of these characters, such as \b,\n and \t, to represent special conditions such as backspace, new line, and horizontal tab, respectively These character combinations are known as escape sequences. Identifiers Identifiers are names that are given to various program elements, such as variable, functions and arrays. Identifiers consist of letters and digits, in any order, except that

Programming in C the first character must be a letter.; Both upper- and lowercase letters are permitted, though common usage favors the use of lowercase letters for most types of identifiers. Upper- and lowercase letters are not interchangeable. The underscore (_) character can also be included, and is considered to be a letter. An underscore is often used in the middle of an identifier. An identifier may also begin with an underscore, though this is rarely done in practice. The following names are valid identifiers: x y12 sum_1 tax_rate area _temperature

Key words There are certain reserved words, called keywords, which have standard, predefined meanings in C. These keywords can be used only for their intended purpose; they cannot be used as programmer-defined identifiers. Some standard keywords are: auto extern Sizeof Break floatn static case for void char

switc regist retur long int else while short h er n

Some C compilers may recognize other keywords. Note that the keywords are all lowercase. Since uppercase and lowercase characters are not equivalent, it is possible to utilize an uppercase keyword as an identifier. Normally, however, this is not done, as it is considered a poor programming practice.

Programming in C

You might also like