top of page

Programs on Apex Salesforce

  • Writer: Abhilash Banpurkar
    Abhilash Banpurkar
  • Oct 2, 2022
  • 1 min read

Updated: Oct 6, 2022

Print a Program in Apex :


Print Oscar I.t Solutions


system.debug('Oscar I.t Solution');

Output:



Add two Number In Apex


Integer num1 ,num2;
num1 = 10;
num2 = 20;
System.debug('the sum is' + (num1 + num2));

Output:




Some Arithmatic Operation in Apex Salesforce


Integer num1, num2;
num1 = 10;
num2 = 20;
System.debug(‘the sum is ‘ + (num1 + num2));
System.debug(‘the subraction is ‘ + (num1 – num2));
System.debug(‘the product  is ‘ + (num1 * num2));
System.debug(‘the division is ‘ + (num1 /num2));


Output :


Swapping of Two Number in Salesforce Apex


integer num1,num2;
num1=10;
num2=20;
num1=num1-num2;
num1=num1-num2;
num2=num2+num2;
system.debug(‘the value of a is’ + num1);
system.debug(‘the value of b is ‘ + num2);

Output:


Convert Feet into Inches


integer feet
Feet = 10;
System.debug(‘the number of inches is ‘ +(feet * 12));

Output:







Recent Posts

See All
Important Trigger Solved Questions

Create Validation Rule on same Object. trigger oppValidate on Opportunity(before insert,before update) { for(Task tsk:trigger.new){...

 
 
 

Comments


bottom of page