Data type in c programming

Data Type In C Programming.

Data type in c programming.

The character set is predetermined programming fixed operation reserved words and symbols in c programming. which are used in c programming for a particular purpose. many types of fixed keywords and character sets are used by c programmers many times in their daily life and programming development level. these system defined character sets are used for certain programming purposes.

Character set used in c programming – in c programming in character set, you can use a small alphabet from a to z, a number integer from 0 to 9, a keyboard special character key in a special character, white space, and other characters in set programming. Below you have been given the use of some character type of symbols.

The basic c source character set includes the following characters:

  • Letters: a – z, a – z, _
  • Digits: 0 – 9
  • Punctuation: ~! @ # % ^ & * ( ) – + = : ; ” ‘ < > , . ? | / \ { } [ ]
  • Whitespace characters: space, horizontal tab, vertical tab, form feed, newline

Constant – constant variables are used as containers in c programming. But in the programming of constants, the value declared as constant cannot be changed after declaration. The constant data type can be a constant hold fixed defined value, constant character, integer, float, double or long double, the data type. Sometimes in c programming, the programmer needs to represent a fixed value with a specific meaning. Constants never change before and after the program expects. The constant keyword used while declaring any constant in c programming should correct the declaration of these with the data type.

Constant type is.

  • Character constant.
  • Integer constant.
  • Float constant.
  • String constant.
  • Octal constant.
  • Hexadecimal constant.

Character constant – character constant stores single character subsequent / alphabet, enclosed in inverted comma, memory can store maximum character constant in single bytes. In c programming, character constants store fixed single characters or groups of array character values.character constant store single character latter/alphabet, enclosed in inverted comma, maximum character constant store in memory single bytes.

Constant data typeConstant declareMeaning of constant


Char
Const char x=”a”;Declare x character constant, which hold character a value
Const char name[20]=”computer”;Name character constant declare with arrays 20 store elements
Const char store[ ]={‘c’,’o’,’m’,’u’,’t’,’e’,’r’}Fixed arrays with character constant ,store fixed character

Integer constant – integer constants are declared with integer decimal numbers. Integer constants are declared with a positive or negative sign. And integer constants store the default 2 bytes of data space in computer memory. Integer constants hold fixed numbers, or decimal, values in c programming.

Constant data typeConstant declareMeaning of constant

Int
Const int x;Declare integer x constant
Const int a=20;Declare a integer constant ,with 20 integer fixed value
Const int number[5 ];Declare number integer constant, with 5 different number

Float constant – unlike integer constant, in float constant, you store decimal value in point along with integer. It stores floating numbers in integer format with a decimal point. The floating constant becomes constant after the variable declaration in c programming. By default c programming stores the float value in 4 bytes of memory.

Constant data typeConstant declareMeaning of constant

Float
Const float x;Declare float x constant
Const float a=20;Declare a float constant ,with 20 floating fixed value
Const float number[5 ];Declare number float constant, with 5 different float number

String constant – you can declare string constant with character, can use character declared arrays variable, now will store character string in it, here string constant must be of string type and so on it will also be decided that no change allowed should not be given. You can also use single character characters with strings and arrays in string constant.

Constant data typeConstant declareMeaning of constant

String
Const char x;Declare character x constant
Const char text[10]=”abc”;Declare a text constant ,with 10 character fixed value
Const char store[ ]=;{‘a’,’n’,’i’,’m’,’a’,’t’,’i’,’o’,’n’};Declare character string constant, with store different character number

Octal constant – the octal constant represents the octal number. Its base 8 is the sum of eight digits. As with other octal constants that will never change their value after the declaration in c programming, an octal constant is a number. and has to be declared with the integer data type. Remember, integer constant starts always range from 0 to 9. Whereas octal constants are used in integer format 0 to 7.

Ex – int a=012;

Int sal=01458;

Hexadecimal constant – hexadecimal constant includes process data numbers and alphabets. The base of the hexadecimal constant is 16. Declare in hexadecimal c programming with integer data type and any number starting from 0x.

Ex – int p=0x4788;

Int q =0x4558;

Basic step to design any program.

1. Create program in your brain logics.

2. Design program algorithms.

3. Construct program condtion and logics flow chart.

4. Start program construction in development software.

5. product accurate program output.

Basic symbol used in c programming.

Other character set symbol and description.Other character set symbol and description.
, – coma operator. – dot
: – colon; – semi colon
‘ – single quote” – double quote
( – open parenthesis) – close parentheses
[ – left bracket] – right bracket
{ – left curly braces} – right curly braces
() – function[ ] – array subscript
\n – new line\t – tab space
\b – bell\\ – double slash
# – hash (preprocessor sign)\ – slash
* – as trick* – pointer
& – ampersand address operator/* */ – comment
-> – pointer to structure**p – pointer to pointer

Reserved keyword in c programming.

C programming has 32 keywords (reserved words):

Auto

Break

Case

Char

Const

Continue

Default

Do

Double

Else

Enum

Extern

Float

For

Goto

If

Int

Long

Register

Return

Short

Signed

Sizeof

Static

Struct

Switch

Typedef

Union

Unsigned

Void

Volatile

While

Some other c programming keyword added later.

_

Bool

_complex

_imaginary

Inline

Restrict

_alignas

_alignof

_atomic

_generic

_noreturn

_static_assert

_thread_local

Tokens in c programming.

Token – tokens have a specific meaning or some system-defined program object in the programming context. Where each token is designed and pre-reserved for a unique purpose in c programming. Where tokens are used to develop program infrastructure.
TokenExampleMeaning
KeywordVoid, for, int, while, if, elseDeclare all are keywords and reserve them for specific meaning in the c program
ConstantConst int x=10; const float temp=10.25; const char x=”a”Declare integer, float, and character constant variable value never changes.
Special symbol[] () {} ! # ^ * @Special symbol building program structure
IdentifiersInt a, char c_name[50], float rent;Identifiers are variable, store or hold associate memory elements in the storage location
StringChar name [] =”computer”;String are text, paragraphs store multiple characters in memory
Operators+ – / * % ^Operator performs operand on given program condition
Rate this post

1 thought on “Data Type In C Programming.”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top