Use a variable of type int - C Data Type

C examples for Data Type:int

Introduction

Conversion specifiers in printf() always start with a % character.

Use the escape sequence %% when you want to output a % character.

Demo Code

#include <stdio.h>

int main(void)
{
  int salary;                               // Declare a variable called salary
  salary = 10000;                           // Store 10000 in salary
  printf("My salary is %d.\n", salary);
  printf("My salary is %%d.\n", salary);
  return 0;/*ww w  .  j  av  a2 s. c om*/
}

Result


Related Tutorials