-
Error in printing series 1, (1+1)^2= 4, (4+1)^2 =25 upto 10 terms.
Error in printing series 1 , (1+1)^2= 4 , (4+1)^2 =25 upto 10 terms.
Code:integer i , n1=1 , n2=1 , n3=2 , n4=1 , count=10;
for(i=0;i<count;i++)
{
n4 = (n1+n2)*(n1+n2);
System.debug(n1 + ', (' + n1 + '+' + n2 + ')^' + n3 + '=' + n4 + ' , ');
n1=n4;
}Screenshot:

debug in different lines not in a single line . How to debug in a single line like a whole series?
Log In to reply.
Popular Salesforce Blogs
Optimize Field Service Routes With Salesforce: Scenarios of Use
Route optimization is the process of figuring out the quickest and most economical route for your mobile field service agents to travel between appointments. Why…
How ChatGPT Integration With Salesforce Can Accelerate Your Business Growth
ChatGPT is a new-age artificial intelligence (AI) chatbot that interacts with people in a human manner. It is a futuristic Generative Pre-trained Transformer (GPT) that…
JanBask's Salesforce Service Cloud Certification Program Acknowledged as a Top Choice
In today's rapidly evolving business landscape, providing exceptional customer experiences has become the cornerstone of success. As organizations strive to meet and exceed customer expectations,…
Popular Salesforce Videos
Salesforce Advanced Code Searcher | Productivity Hack
By using the advanced quick find you can get your code a few clicks shorter. Also, you can search any string your code. Using this…
Process Builder - A Tool every Salesforce Developer must know
Salesforce Process Builder - A Tool every Salesforce developer must know. Learn how to master Process builder Salesforce to automate your business processes. In this…
Introduction to Lightning Web Components | Hello World | Key Concepts
In this video, We are going to learn the new concept/technology that Salesforce has recently introduced to us. Below is the agenda that we are…
