View Code of Problem 78

#include<stdio.h>
#include<string.h>
int main()
{
	char s1[100],s2[100],s3[100],t[100];
	scanf("%s%s%s",s1,s2,s3);
  	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,t);
        }
  	priintf("%s\n%s\n%s\n",s1,s2,s3);
  	return 0;
}
/*
Main.c: In function 'main':
Main.c:7:14: error: 'a' undeclared (first use in this function)
    if(strcmp(a,b)>0)
              ^
Main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
Main.c:7:16: error: 'b' undeclared (first use in this function)
    if(strcmp(a,b)>0)
                ^
Main.c:13:16: error: 'c' undeclared (first use in this function)
    if(strcmp(a,c)>0)
                ^
Main.c:25:4: warning: implicit declaration of function 'priintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
    priintf("%s\n%s\n%s\n",s1,s2,s3);
    ^~~~~~~
    printf
*/

Double click to view unformatted code.


Back to problem 78