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 the number did not become zero.

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

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

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

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

Can we find out the function declaration definition and call the function we used in the above program?

আমি ফাংচন ঘোষণাৰ সংজ্ঞা বিচাৰি উলিয়াব পাৰোঁ নে আৰু ওপৰোক্ত প্ৰ’গ্ৰামত ব্যৱহাৰ কৰা ফাংচনটোক কল কৰিব পাৰোঁনে?

We can 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.

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

This syntax works when the definition of the function appears before it is called. In the program the function is called in line number 17 while it is defined from line number 2 itseIf.

এই বাক্যবিন্যাসটোৱে কাম কৰে যেতিয়া ফাংচনটোৰ সংজ্ঞা টো কোৱাৰ আগতে ওলায়। প্ৰ’গ্ৰামটোত ফাংচনটোক শাৰী নম্বৰ 17-ত কোৱা হয় আনহাতে ইয়াক শাৰী নম্বৰ 2 ইটচেইফৰ পৰা সংজ্ঞায়িত কৰা হয়।