The first problem is that the variable i has not been initialized. The second problem is that you are checking the wrong array index. See the comments in the modified version of your code below.
#include #include int main(){
int num\[50\], i, j;
int count = 0;
i = 0; // Added this
printf("Enter your integer: \\n");
do{
scanf(" %d", &num\[i\]);
count++;
}while(num\[i++\]!=0); // Changed this
for(j=1; j<= count; j++){
if(num\[1\] > num\[j\]){
num\[1\] = num\[j\];
}
}
printf("%d is the greatest of them all !", num\[0\]);
return 0;
}