C data types are defined as the data storage format that a variable can store a data to perform a specific operation. Data types are used to define a variable before to use in a program. Size of variable, constant and array are determined by data types. C – data types: There are four data types in C language. They are, Types Data Types Basic data types int, char, float, double Enumeration data type enum Derived data type pointer, array, structure, union Void data type void 1. Basic data types in C language: 1.1. Integer data type: Integer data type allows a variable to store numeric values. “int” keyword is used to refer integer data type. The storage size of int data type is 2 or 4 or 8 byte. It varies depend upon the processor in the CPU that we use. If we are using 16 bit processor, 2 byte (16 bit) of memory will be allocated for int data type. Like wise,
printf() and scanf() functions are inbuilt library functions in C programming language which are available in C library by default. These functions are declared and related macros are defined in “stdio.h” which is a header file in C language. We have to include “stdio.h” file as shown in below C program to make use of these printf() and scanf() library functions in C language. 1. printf() function in C language: In C programming language, printf() function is used to print the “character, string, float, integer, octal and hexadecimal values” onto the output screen. We use printf() function with %d format specifier to display the value of an integer variable. Similarly %c is used to display character, %f for float variable, %s for string variable, %lf for double and %x for hexadecimal variable. To generate a newline,we use “\n” in C printf() statement. Note: C language is case se