How to use basic Data types in c language




BASIC DATA TYPES IN C LANGUAGE

ANSI C provides three types of data types

A data-type in C programming is a set of values and is determined to act on those values. C provides various types of data-types which allow the programmer to select the appropriate type for the variable to set its value.
The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. Some of them are an integer, floating point, character, etc. Usually, programming languages specify the range values for given data-type.
C Data Types are used to:
  • Identify the type of a variable when it declared.
  • Identify the type of the return value of a function.
  • Identify the type of a parameter expected by a function.
Three more data types have been added in C99:
  • _Bool
  • _Complex
  • _Imaginary

Data Types and Variable Declarations 

#include <stdio.h> int main() { int a = 4000; // positive integer data type float b = 5.2324; // float data type char c = 'Z'; // char data type long d = 41657; // long positive integer data type long e = -21556; // long -ve integer data type int f = -185; // -ve integer data type short g = 130; // short +ve integer data type short h = -130; // short -ve integer data type double i = 4.1234567890; // double float data type float j = -3.55; // float data type }

For complete Information about Basic Data Types click on following link

https://www.encodetraining.com



Thanks

Mahesh V Kondawar
        (Trainer)

encodetraining@gmail.com



Comments

Popular posts from this blog

The History of c programming language | Everything you need to know

Complete Syllabus of C programming from Beginners to Advance or System Level

Technical Aspects of Fundamental Data types in C