What are Integers - C Data Type

C examples for Data Type:Introduction

Introduction

Integers are whole numbers that represent positive and negative numbers.

For eample, -3, -2, -1, 0, 1, 2, and 3, but not decimal or fractional numbers.

Integer data types hold a maximum of four bytes of value and are declared with the int keyword.

Demo Code

#include <stdio.h> 
int main() /*w  ww  . j a  v a2s  .c  om*/
{ 
  int x;   
  printf("integer x declared."); 
} 

Result

You can declare more than one variable on the same line using a one declaration.

#include <stdio.h> 
int main() 
{ 
  int x, y, z; 
  printf("three integer declared."); 
}

Related Tutorials