#include"stdio.h"
int main(int argc,char*argv[])
{
float a,b,c,*pa=& a,*pb=& b,*pc=& c,max;
scanf("%f,%f,%f",pa,pb,pc);
if(*pa& gt; *pb)
{
max=*pa;
printf("if1%f\n",max);
}
else
{
max=*pb;
printf("else\n");
}
if(*pc& gt; max)
{
max=*pc;
printf("if2\n");
}
printf("max=%f\n",max);
return ;
}
Extended information:
Usage of printf ()
printf () is a standard library function of C language, which is used to output formatted strings to standard output. The standard output, that is, the standard output file, corresponds to the screen of the terminal. Printf () is declared in the header file stdio.h
function prototype:
int printf(const char*format, ...);
return value:
correctly return the total number of characters output, and return a negative value for errors. At the same time, the iostream error flag will be set, and the indicator ferror can check the error flag of iostream.
call format:
the call format of the printf () function is: printf ("formatted string", output table column).
a formatted string contains three objects, namely:
(1) a string constant;
(2) format control strings;
(3) escape characters.
the string constant is output as it is, which plays a prompt role in the display. Each output item is given in the output table column, which requires that the format control string and each output item should correspond to each other in number and type. Among them, the format control string is a string starting with%, followed by various format control symbols to explain the type, width and precision of the output data.