C Language Cheatsheet For Beginner - csesolution

                              Let’s us know about  - c                   

 

                                                                           

C Language Cheatsheet For Beginner 

 

About the c history –   

 C is a programming language  developed by Dennis Ritchie in 1972 at AT & t’s bell laboratories (USA). C became popular because it is simple and easy to use. 

 

 

C  language cheatsheet

 

Learn C with simple method :

If you are learning C programming you also know about steps in learning English language because if you learn c programming language with compare other language then you easily learn c language. Now I will compare with English language  because There is a close analogy between learning English language and learning c language

 

 

                                         

Steps in learning English Language

Alphabets

Words

Sentences

Paragraph

 

 

 

 

 

 

 

 

Steps in learning C language

Alphabets

Digits

Special symbols

Constants

Variables

Keywords

 

Instructions

 

Programs

 

 

Alphabets , Digits , & special symbols

Alphabets         A, B,C,D…………..Y,Z

                           a , b , c,……………y ,z

 

Digits       0,1,2,3,4,5,6,7,8,9

 

Special symbols   , . / <> ? ; ’ \ : ” | - = _ + [] {} ! @ # $ % ^ & * ~ `

 

 

 

 

 

 



Let’s briefly discuses symbols=

 

 

Constants, Variables And keywords

The Alphabets  digits and special symbols when properly combined from constants , variables and keywords .

 

Types of c constants :

There are two major categories constants in C language

 1. primary constants

 2. Secondary constants


Primary Constants 

Primary constants in C can be divided in to three categories

1. Integer

2. Real Constants

3. Character Constants

Secondary Constants 

 Secondary Constants there are:

  1. Array
  2. Pointer
  3. Structure
  4. Union
  5. Enum

Some Instruction of Integer Constants :

   1. Range for Integer constants is (-2147483648 to +2147483647).

   2. “,” are not allowed within an integer constant

   3. blanks      not allowed in an integer constant.

   4. An integer constant must have at least one digit.

   5. It must not have a decimal point like that= (35566.356) not Allowed


Example of Integer Constants are allowed :

       424   +466  -32575  +2354  -356  35466

Note :- Integer Constants range depends upon compiler

 

Some Instruction of Real Constants :

Real Constants/Floting Point Constants. Real constants divided into two form.

Real Constants

1. Fractional Form

2. Exponential Form

 

Fractional Form :

Real constant Expressed in fractional form:-                 

     1. it must have a decimal point.

     2. A real constant must have at least one digit.

     3. No commas or blanks are allowed within a real constants.

     4. it can be positive or negative


Note :  In real constants  default sign is positive

EX:-   +456.744  235.9   -423.76   3298

 

Exponential Form 

The Exponential from use when the real constants value is either too small or to large.

the real constants is represented in 2 parts in Exponential From. The part before ‘e’is called mantissa, where as the part following ‘e’ is called exponent

Real Constants in Exponential Form

1. The mantissa part and the exponential part in real Constants separate by ‘e’or ‘E’

2. the mantissa sign allow possitve or negative . default sign is positive

3. the exponent  sign allow possitve or negative . default sign is positive

4. Range of real constants in exponential form is : -3.4e38 to 3.4e38

EX:-  +3.2e-5,  4.1e6 , -0.3E+6

 

Note:

 Remember this point in c language a character constants is a single digit, Single alphabet or single special symbol enclosed in single inverted commas.

Like as :- ’A’

 

Let’s know about C Keywords :

Keywords in c language means some special keyword already explained in c library to the c compiler there are only 32 keywords available in C.


1. auto

2. double

3. int

4. struct

5. break

6. else

7. long

8. switch

9. case

10. enum

11. register

12. typedef

13. char

14. extern

15. return

16. union

17. const

18. float

19. short

20. unsigned

21. continue

22. for

23. signed

24. void

25. do

26. if

27. static

28. while

29. volatile

30. sizeof

31. goto

32. default

 

 

Comment in C :

There are two type comment in C language. are called first one line Comment and second are called two or multi line Comment.

Comment are used in a c program to clarify the purpose of the program.

Comment used basic know about program , its author and the date on which the program was written.

Like as : 

One line comment use

// this is my first program in c

 

Like as :

Multi line comment use

/* This program use in

   Simple interest

   For given value for user */

 

 

 

Post a Comment

0 Comments