Sabtu, 03 Oktober 2015

Data Type in C (input and output)

Data type in C

This is basic code in C,with this code you can create any program in C there has input and output


Input : In any programming language input means to feed some data into program. This can be given in the form of file or from command line. C programming language provides a set of built-in functions to read given input and feed it to the program as per requirement.

Output : In any programming language output means to display some data on screen, printer or in any file. C programming language provides a set of built-in functions to output required data.

Here we will discuss only one input function and one putput function just to understand the meaning of input and output. Rest of the functions are given into C - Built-in Functions



Basic data types Of C language:

integer type
This type is used to define integer numbers. It is denoted as "int" in the C programs in this c programming tutorial
{
int number;
number = 5;
}
Floating-point types.
This type is used to define decimal numbers. It will be denoted as "float" in the c language
{
float Miles;
Miles = 5.6;
}
Boolean type
The Boolean type is used to define a variable that consists of only two values true or false
{
bool b = getc(stdin) == 't' ? true : false;
}

double - data type
Double in c language is used to define BIG decimal point numbers. The memory reserved for this datatype is twice as compared to int datatype. Likely to be 8 bytes.
{
double Atoms;
Atoms = 2500000;
}

char - data type
char data type defines characters in a c program.

{
char alphabet;
alphabet = 'x';
}
Enumerated types in C language:
They are also arithmetic types and they are used to define variables that can only be assigned certain discrete integer values throughout the c program.
The type void:
The type specified void returns no value, meaning no value is available. It is used mainly in functions which returning null or no value.


Tidak ada komentar:

Posting Komentar