Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
import java.util.*;
public class Main 
{
  public static void main (String [] args)
  {
  	int num1,num2;
  	Scanner sc  = new Scanner (System.in) ;
  	num1 = sc.nextInt ();
  	num2= sc.nextInt ();
  	int Quotient = num1/ num2;
  	 int Remainder = num1%num2;
  	System.out.println("Quotient:"+quotient);
  	System.out.println("Remainder:"+remainder);
  	    }
 }

What I have tried:

Main.java:12:error:cannot find symbol 
System.out.println("Quotient:"+quotient );
Symbol:variable quotient 
Location:class Main 
I am getting like this what is error in this please help.
Posted
Updated 2-Dec-20 2:05am

1 solution

The reference to quotient is all lower case 'quotient' and not 'Quotient' as is 'remainder'

Try

System.out.println("Quotient:"+ Quotient);
System.out.println("Remainder:"+ Remainder);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900