Skip to content

Instantly share code, notes, and snippets.

@echo-akash
Created August 10, 2017 17:23
Show Gist options
  • Save echo-akash/eacec686bcc5ec54d4614c7363c6bd49 to your computer and use it in GitHub Desktop.
Save echo-akash/eacec686bcc5ec54d4614c7363c6bd49 to your computer and use it in GitHub Desktop.
Print a series of numbers excluding the mentioned number.
#include<stdio.h>
int main()
{
int n,i,x;
printf("enter number range:");
scanf("%d",&n);printf("number to be excluded:");
scanf("%d",&x);
printf("numbers after exclusion:");
for(i=1;i<=n;i++)
{
if(i!=x)
printf("%d ",i);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment