Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  c.c
Language: C/C++
Code:
#include <stdio.h>
#include<conio.h>
int main(void, int argc, char *argv[])
{
     int big,small,mid,a,b,c;
     float avr;
     clrscr();
     printf("enter 3 numbersn");
     scanf("%d%d%d",&a,&b,&c);
     if((a>b)&&(b>c))
     {
          big=a;
          if(b<c)
          {
               small=b;
               mid=c;
          }
          else
          {
               small=c;
               mid=b;
          }
     }
     else if((b>c)&&(b>a))
     {
          big=b;
          if(a<c)
          {
               small=a;
               mid=c;
          }
          else
          {
               small=c;
               mid=a;
          }
     }
     else
     {
          big=c;
          if(b<a)
          {
               small=b;
               mid=a;
          }
          else
          {
               small=a;
               mid=b;
          }
     }
avr=(float)(big+small)/(float)2;
if(avr>(float)mid) printf("avr big then middle number");
else if(avr==(float)mid) printf("avr equal then middle number");
else  printf("avr small then middle number");
return(0);
}
          
          
Comments: