Problem 4: To find the digits of a number

সমস্যা 4: এটা সংখ্যাৰ অংক বিচাৰিবলৈ

This problem is solved in Chapter 4 (see Example 4.14). The logic was to repeatedly use the reminder operation to extract a digit from the right side and then to reduce the number by one tenth. We continued to do so using a loop as long as the number did not become zero.

এই সমস্যাটো অধ্যায় 4-ত সমাধান কৰা হৈছে (উদাহৰণ 4.14 চাওক)। যুক্তিটো আছিল সোঁফালৰ পৰা এটা অংক উলিয়াবলৈ বাৰে বাৰে স্মাৰক অপাৰেচন ব্যৱহাৰ কৰা আৰু তাৰ পিছত সংখ্যাটো এক দশমাংশ হ্ৰাস কৰা। যেতিয়ালৈকে সংখ্যাটো শূন্য নহয় তেতিয়ালৈকে আমি এটা লুপ ব্যৱহাৰ কৰি এইটো অব্যাহত ৰাখিছিলো।

We put this as the definition portion of a function. The function accepts the number parameter and it does not return any value. Example 7.5 shows the complete code.

আমি ইয়াক এটা ফাংচনৰ সংজ্ঞা অংশ হিচাপে ৰাখিছো। ফাংচনটোৱে সংখ্যাৰ প্ৰাচল গ্ৰহণ কৰে আৰু ই কোনো মান ঘূৰাই নিদিয়ে। উদাহৰণ 7.5-এ সম্পূৰ্ণ কোড টো দেখুৱায়।

Example 7.5: A C program for finding the digits of a number using function.

We can see the function definition and function calling in the above code. In fact, the function definition and declaration are written together. There is no separate declaration of the function. This is another syntax in C programming we learned here.

আমি ওপৰোক্ত কোডত ফাংচন সংজ্ঞা আৰু ফাংচন কলিং দেখিব পাৰো। দৰাচলতে, ফাংচন সংজ্ঞা আৰু ঘোষণা একেলগে লিখা হয়। ফাংচনটোৰ কোনো পৃথক ঘোষণা নাই। আমি ইয়াত শিকা চি প্ৰগ্ৰামিংত এইটো আন এটা বাক্যবিন্যাস।