Answers for "replace pi by 3.14 program"

0

replace pi by 3.14 program

import java.lang.Math;
public class Main


{
    
    public static void solve(StringBuffer s,String pi){
      
      
       int n = s.indexOf("pi");
       if(n == -1){
           return;
       }
       s.delete(n,n+2);
       s.insert(n,pi);
       
       
       solve(s,pi);
    }
	public static void main(String[] args) {
		System.out.println("Hello World");
		int arr[] = {1,2,3,4,5,60};
		StringBuffer n = new StringBuffer("pippppiiiipi");
		solve(n,"3.14");
		System.out.println(n);
	}
}
@code by sujith_thota
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language