Read an integer and then prints all the integers from that value up to a value larger by 10. - C Data Type

C examples for Data Type:int

Introduction

If the input is 5, the output runs from 5 to 15.

Demo Code

#include <stdio.h>

int main(void)
{
  int input;/*  w  w w  . j av a 2 s.  c o  m*/
  int i = 0;

  printf("Enter an integer: ");
  scanf("%d", &input);
  
  while (i <= 10)
  {
    printf("%d\n", input + i);
    i++;
  }

  return 0;
}

Result


Related Tutorials