Skip to main content

IDENTIFIERS AND KEYWORDS

IDENTIFIER: ldentzfiers are names that are given to various program elements, such as variables, functions and arrays.Identifiers consist of letters and digits, in any order, except that 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.An identifier can be arbitrarily long. Some implementations of C recognize only the first eight characters, though most implementations recognize more (typically, 3 1 characters). Additional characters are carried along for the programmer's convenience. 



Some Valid Identifier:

1.  
2.   Y
3.   sum
4.   name
5.   area
6.    mouse 
7.   nano etc 
keyword:There are certain reserved words, called keywords, that have standard, predefined meanings in C. These
keywords can be used only for their intended purpose; they cannot be used as programmer-defined identifiers.


The standard keywords are:


1.   auto 
2.   extern
3.   sizeof
4.   break
5.   f l o a t n s t a t i c
6.   case 
7.   f o r s t r u c t
8.   char
9.   got0
10.       switch
11.       const
12.       i f 
13.       typedef
14.       continue
15.       i n t
16.       union
17.       d e f a u l t I 
18.       long
19.       unsigned
20.       do
21.       r e g i s t e r 
22.       void
23.       double
24.       return
25.       v o l a t i l e
26.       else
27.       short
28.       while
29.       enum 
30.       signed

Comments

Popular posts from this blog

Object-Oriented Programming and JAVA Programming Language

  Object-Oriented Programming and:   Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, olymorphism, and inheritance. Many modern programming languages now support OOP, at least as an option. JAVA Programming Language: Object-oriented programming is at the core of Java. In fact, all Java programs are object-oriented, this isn’t an option the way that it is in C++, for example. OOP is so integral to Java that you must understand its basic principles before you can write even simple Java programs. Therefore, this chapter begins with a discussion of the theoretical aspects of OOP.

DIFFERENCE BETWEEN IDENTIFIER AND KEYWORD

Identifier keyword Identifiers are names that are given to various program elements, such as variable, function and arrays. C take some reserved word called keyword, they have predefine meaning in C. Identifiers consist of letters and digits. Keyword consist only letter. Identifier’s first character must be a letter. Keyword’s all character is letter. Identifiers Upper and lowercase letter is use. Keywords are all lowercase. Upper and lowercase are not equivalent. Upper and lowercase are also not equivalent. Like: X, sum_5, _weather etc. But 4 th is not identifier cause identifier first character must a letter. Like: auto, short, long etc.

Absolute value and Floating-point absolute value function in C Programming Language

Absolute value function in C Programming Language is abs(i), Its return the absolute valu of i. where  i  is any positive or negative  number. It is integer type function. The include file of abs(i) is stslib.h Observe under program: #include<stdio.h> #include<stdlib.h> int main(void) { int a; scanf("%d",&a); printf("%d",abs(a)); } Here I use a integer number. Input it by scanf and print the Absolute value by abs() function. Floating-point Absolute value function in C Programming Language is fabs(i), Its return the absolute valu of i. where  i  is any positive or negative  Floating-point number. It is double integer type function. The include file of fabs(i) is math.h Observe under program: #include<stdio.h> #include<stdlib.h>  int main(void) { float a; scanf("%f",&a); printf("%.2f",fabs(a)); } Here I use a integer number. Input it by scanf and print the Floating-point Absolute value b...