[ create a new paste ] login | about

Link: http://codepad.org/erAm5pCz    [ raw code | output | fork ]

C, pasted on Aug 12:
#include <stdio.h>

int max(int x,int y);

int main(void)
{
	int num1,num2,ans;
	int (*pM)(int x,int y);
	
	pM = max;
	
	puts("1番目の数値");
	scanf("%d",&num1);
	
	puts("2番目の数値");
	scanf("%d",&num2);
	
	ans = (*pM)(num1,num2);
	
	printf("最大値は:%d\n",ans);
	
	return 0;
}

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


Output:
1
2
3
1番目の数値
2番目の数値
最大値は:134513601


Create a new paste based on this one


Comments: