The maximum of three numbers code

来源:互联网 发布:windows 开源shell 编辑:程序博客网 时间:2024/05/16 07:49

This is my first C code, if you have a pleasure please give me some suggestion.


#include<stdio.h>
#include<string.h>

int max(int x,int y,int z);

int main()
{
                int a,b,c,z;
                scanf("%d,%d,%d",&a,&b,&c);
                z=max(a,b,c);
                printf("the max is %d\n",z);
                return 0;
}

int max(int x,int y,int z)
{
                int maxmium;
                if(x>y)
                {
                        maxmium=x;
                }else
                {
                        maxmium=y;
                }
                if(maxmium>z)
                {
                        ;
                }else
                {
                        maxmium=z;
                }
                return maxmium;
}