The constants are the values which never changes. The C uses following types of constants. Integer constants : Integer constants represent the whole numbers. They uses digits 0 to 9 and optional sign + or - before the number. The following are examples of valid integer constants. 123 -23 65535 0 +85 The space, comma and other special symbols are not allowed. The following are examples of invalid integer constants. 10,000 $500 15 780 Real Constant : Real Constants represent the numbers with fractional parts i.e digits after decimal point. They are used to represent contiguous quantities like temperature of day. The following are examples of valid real constants. 0.0005...
There are four basic data types supported by C. Table lists the basic data types with their size in bytes and the range of values. Type Size In bytes Range char 1 -128 to +127 int 2 - 32768 to +32767 float 4 3.4e-38 to 3.4e+38 double 8 1.7e-308 to 1.7e+308 The C provides different qualifiers like signed , unsigned , short and long. By applying the qualifiers to the basic data types, we can change the range of our data type as per need. Table lists the various data types available by applying the qualifiers to the basic data types with their size and range of values. Type Size in bytes Range char(signed char) 1 -128 to +127 unsinged char 1 0 to 255 ...
The identifiers are user defined names used in programs for providing names to variables, arrays and functions. The identifiers are made up of letters(uppercase and lowercase), digits and underscore(_). For Example, int max ; //max is an identifier which have datatype integer int max2; //this is second identifier of same datatype string max_3; //you can also use identifier like this with different datatype and underscore float 4max ; //you can not declare identifier like this this will generate an error The C is case sensitive and hence the uppercase and lowercase letters are not treated as same. For Example, int max=20 ;// this is a different variable which assigns a value 20 to max int Max=10 ; //this is different variable which assigns a value 10 to Max Identifiers also used to identify functions. For Example, int Add() ; //this is a Function which is created for addition of two integer; Program Aim : - This Program will help you ...
Comments
Post a Comment