I could get the largest without using arrays but, unable to get the smallest one.
public static void main(String[] args) { int smallest=0;
Try this :
int smallest = Integer.MAX_VALUE; for(int i=0;ilarge) { large=num; } if(num