In this program, I cannot in put - integer. It outputs wrong result. What should I do to make it possible? Thanks heaps !!!
#include<stdio.h>
int main(){
int num;
int max=0;
printf("Enter +/- integers or enter 0 to Exit \n");
while(1){
scanf("%d",&num);
if(num==0)
break;
if(num>max)
max=num;
}
printf("Max is %d",max);
return 0;
}