include stdio include stdlib run this program using the console pauser

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
double x,m;
printf("m=");
scanf("%lf=",&m);
if (m!=0)
{ do
{
printf("x=");
scanf("%lf=",&x);
m=(m>x?m:x);
}
while (x!=0);
}
printf("max = %lf\n",m);
system ("PAUSE");
return 0;
}