-2
import java.io.*;

import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.lang.*;

public class Solution {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        int n=sc.nextInt();
  for ( n=1 ; n<11; n++){
        int z = a + b(Math.pow(2,n+1) - 1) ;
      System.out.println(z);
     }
   } 
 }

and the error says like this Compile time error Compile Message Solution.java:18: error: cannot find symbol

int z = a + (b) (Math.pow(2,n+1) - 1) ;
                    ^
  symbol:   class b
  location: class Solution
1 error
Mifeet
  • 12,949
  • 5
  • 60
  • 108
Nikhil Goyal
  • 23
  • 1
  • 5

1 Answers1

3

Are you trying to multiply the int b with (Math.pow(2, n+1) - 1)? If so, then you are missing a * to signify a multiplication sign likely causing the error. You can read more about the error on this post:

Post on 'Cannot Find Symbol'

Community
  • 1
  • 1
Andrew Li
  • 55,805
  • 14
  • 125
  • 143