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
TUSHAR KHORGADETUSHAR KHORGADE 

i am stuck in one program can anyone please sort it out

Create a map populate it with two records Odd and Even. Run a loop from 1-50, if you find a even number increase the count for even named record in map or else increase count of odd named record. Odd and even are keys, counts are values. Example map syntax: Map<String,integer> CountNumber = new map<String,Inetger>({'Even':4},{'Odd':3});
AbhinavAbhinav (Salesforce Developers) 
If its req is just to have count of odd and even , I think you can have a count of them firtswhilte iteratinh and then map it wit keys.