Functions (प्रकार्य)
A function is a block of code designed to perform a specific task and executed when "something" invokes it. More info about functions can be found in the functions chapter.
प्रकार्य एक विशिष्ट कार्य प्रदर्शन गर्न डिजाइन गरिएको कोडको ब्लक हो र "केहि" ले यसलाई आह्वान गर्दा निष्पादित हुन्छ। प्रकार्यहरूको बारेमा थप जानकारी प्रकार्यहरू अध्यायमा फेला पार्न सकिन्छ।
📝 Task:
[ ] Write a program to create a function named
isOddthat passes a number45345as an argument and determines whether the number is odd or not.[ ] ४५३४५ नम्बरलाई तर्कको रूपमा पास गर्ने र सङ्ख्या विषम छ वा छैन भनेर निर्धारण गर्ने
isOddनामको प्रकार्य सिर्जना गर्न प्रोग्राम लेख्नुहोस् ।- [ ] Call this function to get the result. The result should be in a boolean format and should return
trueinconsole. - [ ] परिणाम प्राप्त गर्न यो प्रकार्यलाई कल गर्नुहोस् । परिणाम बुलियन ढाँचामा हुनुपर्दछ र कन्सोलमा सही फर्कनुपर्छ।
💡 Hints:
Visit the functions chapter to understand functions and how to create them.
प्रकार्यहरू बुझ्न र तिनीहरूलाई कसरी सिर्जना गर्ने भनेर प्रकार्यहरू अध्यायमा जानुहोस्।