View Code of Problem 78

#include<stdio.h>
#include<string.h>
int main(){
char a[100],b[100],c[100],t[100];
  gets(a);
  gets(b);
  gets(c);
  if(strcmp(a,b)>0{
  strcpy(t,a);strcpy(a,b);strcpy(b,t);
  }
   if(strcmp(a,c)>0{
  strcpy(t,a);strcpy(a,c);strcpy(c,t);
  }
   if(strcmp(b,c)>0{
  strcpy(t,b);strcpy(b,c);strcpy(c,b);
  }
     puts(a);
      puts(b);
      puts(c);
     return 0;
}
/*
Main.c: In function 'main':
Main.c:6:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
   gets(a);
   ^
Main.c:7:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
   gets(b);
   ^
Main.c:8:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
   gets(c);
   ^
Main.c:9:19: error: expected ')' before '{' token
   if(strcmp(a,b)>0{
                   ^
Main.c:22:1: error: expected declaration or statement at end of input
 }
 ^
Main.c:5:27: warning: unused variable 't' [-Wunused-variable]
 char a[100],b[100],c[100],t[100];
                           ^
*/

Double click to view unformatted code.


Back to problem 78