All pastes #827377 Raw Edit

Unbenannt

public text v1 · immutable
#827377 ·published 2007-12-21 18:45 UTC
rendered paste body
#include <stdio.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))

int min(int a, int b); //init funktion min

int main(void)
{
	
    float minwert, maxwert, neu;
    int stopp;
	
	printf("zahl eingeben: ");
    scanf("%f", &maxwert);
	minwert = maxwert;

	
	while (stopp != EOF)
	{
		
		printf("zahl eingeben: ");
		stopp = scanf("%f", &neu);
		maxwert = MAX(maxwert, neu);
		minwert = min(minwert, neu);
	}
	

	
	printf("ergebnis makro MAX: %f\n", maxwert);
	printf("ergebnis funktion min: %f\n", minwert);
	
	
	return 0;
}

int min(int n1, int n2)
{
	int ret;
	
	if (n1 < n2)
		ret = n1;
	else
		ret = n2;
	return ret;
}