View Code of Problem 78

#include<stdio.h>
int main()
{
	char s1,s2,s3,t;
  	gets(s1);
  	gets(s2);
  	gets(s3);
  	if(strcmp(a,b)>0)
        {
        	t=a;a=b;b=t;
        }
  	if(strcmp(a,c)>0)
        {
        	t=a;a=c;c=t;
        }
  	if(strcmp(b,c)>0)
        {
        	t=b;b=c;c=t;
        }
  	puts(s1);
  	puts(s2);
  	puts(s3);
  	return 0;
}
/*
Main.c: In function 'main':
Main.c:5:4: warning: 'gets' is deprecated [-Wdeprecated-declarations]
    gets(s1);
    ^~~~
In file included from Main.c:1:
/usr/include/stdio.h:583:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
Main.c:5:9: warning: passing argument 1 of 'gets' makes pointer from integer without a cast [-Wint-conversion]
    gets(s1);
         ^~
In file included from Main.c:1:
/usr/include/stdio.h:583:14: note: expected 'char *' but argument is of type 'char'
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
Main.c:6:4: warning: 'gets' is deprecated [-Wdeprecated-declarations]
    gets(s2);
    ^~~~
In file included from Main.c:1:
/usr/include/stdio.h:583:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
Main.c:6:9: warning: passing argument 1 of 'gets' makes pointer from integer without a cast [-Wint-conversion]
    gets(s2);
         ^~
In file included from Main.c:1:
/usr/include/stdio.h:583:14: note: expected 'char *' but argument is of type 'char'
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
Main.c:7:4: warning: 'gets' is deprecated [-Wdeprecated-declarations]
    gets(s3);
    ^~~~
In file included from Main.c:1:
/usr/include/stdio.h:583:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
Main.c:7:9: warning: passing argument 1 of 'gets' makes pointer from integer without a cast [-Wint-conversion]
    gets(s3);
         ^~
In file included from Main.c:1:
/usr/include/stdio.h:583:14: note: expected 'char *' but argument is of type 'char'
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
Main.c:8:7: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    if(strcmp(a,b)>0)
       ^~~~~~
Main.c:8:14: error: 'a' undeclared (first use in this function)
    if(strcmp(a,b)>0)
              ^
Main.c:8:14: note: each undeclared identifier is reported only once for each function it appears in
Main.c:8:16: error: 'b' undeclared (first use in this function)
    if(strcmp(a,b)>0)
                ^
Main.c:12:16: error: 'c' undeclared (first use in this function)
    if(strcmp(a,c)>0)
                ^
Main.c:20:9: warning: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    puts(s1);
         ^~
In file included from Main.c:1:
/usr/include/stdio.h:638:30: note: expected 'const char *' but argument is of type 'char'
 extern int puts (const char *__s);
                  ~~~~~~~~~~~~^~~
Main.c:21:9: warning: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    puts(s2);
         ^~
In file included from Main.c:1:
/usr/include/stdio.h:638:30: note: expected 'const char *' but argument is of type 'char'
 extern int puts (const char *__s);
                  ~~~~~~~~~~~~^~~
Main.c:22:9: warning: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    puts(s3);
         ^~
In file included from Main.c:1:
/usr/include/stdio.h:638:30: note: expected 'const char *' but argument is of type 'char'
 extern int puts (const char *__s);
                  ~~~~~~~~~~~~^~~
*/

Double click to view unformatted code.


Back to problem 78