function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Diana S NDiana S N 

i want to show a result announcement by using loop and if statements how to write in class

Sai PraveenSai Praveen (Salesforce Developers) 
HI Diana,

Can you provide more details to the question. Is Announcement some object in salesforce and where do you want to show the result. Is there any VF page ... etc. 

Thanks,
 
Diana S NDiana S N
Hiii This is for loop practice actually concept is I want to show results of students in annomous window by using if and loop concept If I search student name I want the grade of that student And can u help me how to print 2 multiplication table by using loops
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Diana,

You can use the below anonomous block of code for 2 table.
 
system.debug('second table as below');
for(integer i=0;i<11;i++){
    integer j=i*2;
    system.debug('2 *'+i +'=' +j);
}

If this solution helps, Please mark it as best answer.

Thanks,
​​​​​​​