©LPU CSE101 C Programming
©LPU CSE101 C Programming
Tokens
• We have seen that Tokens are broadly classified as:
– Identifiers
– Keywords
– Constants
– Variables
– Strings
– Operators
– Special character
Lion
Spanner
• String Constants
– Set of zero or more characters enclosed in double
quotes (eg: “ ” )
– It is represented as sequence of characters within
double quotes. Example : “This is C programming”
• Floating Constant
– Constants that contains number with decimal
points
Example : 3.14;
309.89
Animal
Tool
Variables to be declared as
• Speed, s1, speed_of_car
Variables to be declared as
• Weight_boy, w1, wb
• Distance_boy, d1, db
• Weight_girl, w2, wg
• Distance_girl, d2, dg 𝑤 1 × 𝑑 1=𝑤 2× 𝑑 2
𝑤𝑏 × 𝑑𝑏=𝑤𝑔 ×𝑑𝑔
• A. TRUE
B. friend
C. export
D. volatile
• A. TRUE
B. friend
C. export
D. volatile
•
• void main()
• {
• int x = 10;
• float x = 10;
• printf("%d", x)
• }
• A. Compilations Error
• B. 10
• C. 10
• D. 10.1
• void main()
• {
• int x = 10;
• float x = 10;
• printf("%d", x)
• }
• A. Compilations Error
• B. 10
• C. 10
• D. 10.1