-
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
LWC vs React: An In-Depth Comparison of Component-Based UI Frameworks
In the ever-evolving realm of web development, where innovation constantly pushes the boundaries of what can be achieved, two front-end frameworks have emerged as leaders…
The Fall of the Third Party Cookie: Here’s What Salesforce Pardot Users Need to Know
Marketers rely on cookies (the kind you cannot eat) to track visitor data and personalize marketing efforts. And like Cookie Monster love them. Google’s recent…
Salesforce Marketing Cloud Connect: Subscriber Key Migration
If you’ve decided to implement Marketing Cloud Connect in your organization, one of the first considerations will be how to handle Subscriber Keys from Sales or Service…
Popular Salesforce Videos
Understanding Products & Pricebooks in Salesforce
In this video, Shrey gave detailed information about products and pricebooks You will also learn: 1. How to add and manage Products in Salesforce? 2.…
Parent to Child SOQL vs Map | Salesforce Training in Apex
Watch this video to learn all about Parent to Child SOQL vs Map. Do let us know in the comment section if you have any…
Integration: MuleSoft Composer for Salesforce
What you can do with MuleSoft Composer for Salesforce Enrich your 360-degree customer view by empowering your Salesforce admins with a no-code solution for quickly…
