Output mismatch

can u tell me why my code is not giving desired output
public static void main(String args[]) {
// Your Code Here

	int minc;
	
	int kp;
	
	Scanner sc = new Scanner(System.in);
	minc=sc.nextInt();
	int maxc;
	maxc=sc.nextInt();
	int step;
	step=sc.nextInt();
	while(minc<=maxc){
      kp=(int) (5/9)*(minc-32);
	
	 System.out.println(minc+" "+kp);
	 minc=minc+step;

	}


}

when you are calculating kp you have written (5/9) as both numerator and denominator are of type integer so it will give you value =0 and thus kp=0…you can modify kp in following ways:
1)kp=(int) ((5.0/9)(minc-32));
2)kp=(int) ((5
(minc-32))/9);
there may be more ways but the main idea is to prevent division of 5 and 9 directly(as integers) as it will always lead to 0

Hi Ishant
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.
Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.