Skip to content

Instantly share code, notes, and snippets.

@qassa
Created September 29, 2013 12:04
Show Gist options
  • Save qassa/6751957 to your computer and use it in GitHub Desktop.
Save qassa/6751957 to your computer and use it in GitHub Desktop.
//найти количество четных чисел в промежутке между целыми
#include<conio.h>
#include<stdio.h>
int countChet (int n, int y){
int i=0,h=0,max,min;
if(n>y){
max=n; min=y;
} else {
max=y; min=n;
}
for(i=min;i<=max;i++)
if(i%2==0) h++;
return h;
}
int main (){
int x,c,f;
scanf("%d%d",&x,&c);
f=countChet(x,c);
printf("%d",f);
getch();
return 0;
}
//найти количество четных чисел в промежутке между целыми
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment