题目内容

The function scmp in the following program returns the first address of the smaller string in the strings pointed by formal parameter pointers s1 and s2. #includechar *scmp (char *s1,char *s2) { if (strcmp(s1,s2)< 0) return(s1); else return (s2); } main() { int i;char string[20],str[3][20]; for (i=0;i <3;i++) gets (str[i]); strcpy(string,scmp(str[0],str[1])); /* strcpy library function copies strings */ strcpy(string,scmp (string,str[2])); printf("%s\n",string); } If inputs three strings in turn: abcd, abba, and abc, the output is ( )

A. abcd
B. abba
C. abc
D. abca

查看答案
更多问题

When a global variable is declared as static, the scope of the variable is limited to the module in this file.

Global variables are stored in dynamic storage.

The valid range of global variables defined in a source program file is ( ).

A. Full scope of this source program file
B. All source program files of a C program
C. All ranges in function
D. From defining the location of the variable to the end of the source program file

You can omit the length of a column when defining a 2D array and initializing it.

答案查题题库