Solved

# Urgent!!! Can't find the problem...

Posted on 2003-10-29

I wrote a program to find the bigger and the smaller number in a list but there's something wrong and don't know what it is becuse the program just gives me the biggest number while in the smaller number always appear 0. Thanks for your help!!!

Here it is:

#include <stdio.h>

void main()

{

int arr[10], n, dat, max=0, min=0;

for(n=0;n<=9;n++)

{

printf("Number: ");

scanf("%d",&dat);

if(dat>max)max=dat;

if(dat<min)min=dat;

}

printf("Bigger %d Smaller %d",max,min);

}