‘C’ program to display all numbers between two given numbers.

C File =>


/* Write a ‘C’ program to display all numbers between two given  numbers. */

#include<stdio.h>
int main() 
{
      int n,m,i;
      printf("\n Enter first number : ");
      scanf("%d",&n);
      printf("\n Enter last number : ");
      scanf("%d",&m);
 
      for(i=n+1;i<m;i++)
            printf("%d\t",i);
      return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.