Skip to content

Instantly share code, notes, and snippets.

@rkhang7
Created November 15, 2018 02:58
Show Gist options
  • Save rkhang7/1ab8475adbdc950f0e831ea49e0eff6c to your computer and use it in GitHub Desktop.
Save rkhang7/1ab8475adbdc950f0e831ea49e0eff6c to your computer and use it in GitHub Desktop.
#include <stdio.h>
int search(int a,int b,int c)
{
if(a<b&&a>c || a>b&&a<c)
return a;
else if(b<a&&b>c||b>a &&b<c) return b;
else return c;
}
int main()
{
int a,b,c,d;
printf("Nhap a=");scanf("%d",&a);
printf("Nhap b=");scanf("%d",&b);
printf("Nhap c=");scanf("%d",&c);
d=search(a,b,c);
printf("So nho thu 2 la %d",d);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment