function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
public class SumOfOddNumbers { public static void oddmethod(){ integer SumOdd = 0; for(integer i=0;i<=10;i++){ if( Math.mod(i,2) != 0){ system.debug(i); SumOdd+= i; } } system.debug(' SumOdd ==> '+ SumOdd ); } }
Integer sum =0 ; for(Integer i = 0 ; i<=10 ;i++){ if (Math.mod(i, 2) != 0) { sum= sum+i; } } System.debug('-->SUm'+sum);
Hi bro, I can see that you are studying in AJ Skill an year ago
Bro i have a question for you, Are you a Salesforce Developer now?
Try Below Code Please Mark It As Best Asnwer If It Helps
Thank You!
All Answers
Please find the below code for sum of odd numbers between 1 to 10. You can execute this in anonomous window and get the result in logs.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
Try Below Code Please Mark It As Best Asnwer If It Helps
Thank You!
print the answer, can someone answer this?
Hi bro,
I can see that you are studying in AJ Skill an year ago
Bro i have a question for you, Are you a Salesforce Developer now?