5.4 Counting all the even numbers from a series of numbers.

৫.৪ সংখ্যাৰ শৃংখলাৰ পৰা সকলো যুগ্ম সংখ্যা গণনা কৰা।

In the previous program, we ran through the array elements and displayed the ones that were even. Now, we need to count all such numbers.

আগৰ প্ৰগ্ৰেমত আমি এৰে এলিমেণ্টবোৰৰ মাজেৰে দৌৰিছিলো আৰু যিবোৰ ইভেন আছিল সেইবোৰ প্ৰদৰ্শন কৰিছিলো। এতিয়া, আমি এনে সকলো সংখ্যা গণনা কৰিব লাগিব।

Logic for this problem is this: We will initialize a counter to zero. Whenever we see an even umber in the array, we increment the counter value. Finally, the value of the counter will give The number of even numbers in the array. We can demonstrate this logic using Figure 6.4.

এই সমস্যাৰ বাবে যুক্তিটো হ’ল: আমি এটা কাউণ্টাৰক শূন্যলৈ আৰম্ভ কৰিম। যেতিয়াই আমি এৰেত এটা even umber দেখিম, আমি কাউণ্টাৰ ভেলুটো বৃদ্ধি কৰো। শেষত কাউণ্টাৰৰ মানটোৱে এৰেত থকা যুগ্ম সংখ্যাৰ সংখ্যা দিব। আমি চিত্ৰ ৬.৪ ব্যৱহাৰ কৰি এই যুক্তি প্ৰদৰ্শন কৰিব পাৰো।

We may also represent our logic using the below figure that used the array notations. In figure 6.5, totele represents the total numbers stored in the array and number is the number is the name of the array.

আমি তলৰ চিত্ৰটো ব্যৱহাৰ কৰি আমাৰ যুক্তিক প্ৰতিনিধিত্ব কৰিব পাৰোঁ যিয়ে এৰে টোটেচনব্যৱহাৰ কৰিছিল। চিত্ৰ 6.5-ত, টোটেলে এৰেত সঞ্চিত মুঠ সংখ্যাবোৰ প্ৰতিনিধিত্ব কৰে আৰু সংখ্যাটো হৈছে এৰেৰ নাম।

Let us write the code segment for portion below.

তলৰ অংশৰ বাবে কোড খণ্ডটো লিখোঁ আহক।

The complete C program for this problem is presented using Example 6.6

এই সমস্যাৰ বাবে সম্পূৰ্ণ চি প্ৰ’গ্ৰামটো উদাহৰণ 6.6 ব্যৱহাৰ কৰি উপস্থাপন কৰা হৈছে।

Example 6. 6 A C program to calculate total number of even numbers in a series of numbers.