6.1 MOTIVATION

6.1 অনুপ্ৰেৰণা

Let us recall the program for finding the summation of a series of numbers. We can refer to the C program of Example 4.7 as shown below.

সংখ্যাৰ এটা শৃংখলাৰ সাৰাংশ বিচাৰি উলিওৱাৰ বাবে প্ৰ’গ্ৰামটো মনত পেলাওঁ আহক। আমি তলত দেখুওৱাৰ দৰে উদাহৰণ 4.7-ৰ চি প্ৰ’গ্ৰামটো চাব পাৰোঁ।

In this program , We used a single variable ”var” to store the number we entered from the keyboard. Thus everytime we enter a new number from the keyboard, the old one is lost. The variable is declared in line number 4 and the value is stored in it in line number 9.

এই প্ৰ’গ্ৰামত, আমি কীবোৰ্ডৰ পৰা প্ৰবিষ্ট কৰা নম্বৰটো সংৰক্ষণ কৰিবলৈ এটা চলক ”ভাৰ” ব্যৱহাৰ কৰিছিলো। এনেদৰে যেতিয়াই আমি কীবৰ্ডৰ পৰা এটা নতুন নম্বৰ প্ৰবিষ্ট কৰোঁ, পুৰণিটো হেৰাই যায়। চলকটো শাৰী নম্বৰ 4-ত ঘোষণা কৰা হয় আৰু মূল্যটো ইয়াত শাৰী নম্বৰ 9-ত সংৰক্ষণ কৰা হয়।

Now let us think for a while that we require the numbers later on. Suppose. We need to see the largost among these numbers. We may also need those for any other purpose.

এতিয়া আমি অলপ সময়ৰ বাবে ভাবিবলৈ দিওঁ যে আমাক পিছত সংখ্যাবোৰৰ প্ৰয়োজন। ধৰি লওক। আমি এই সংখ্যাবোৰৰ মাজত লাৰ্গোষ্ট চাব লাগিব। আমাক আন যিকোনো উদ্দেশ্যৰ বাবেও সেইবোৰৰ প্ৰয়োজন হ’ব পাৰে।

The most natural way to handle this situation is to store numbers in separate variables and then use them the way we want. We may declare the numbers as follows.

এই পৰিস্থিতিটো নিয়ন্ত্ৰণ কৰাৰ আটাইতকৈ প্ৰাকৃতিক উপায় হৈছে নম্বৰবোৰ পৃথক চলকত সংৰক্ষণ কৰা আৰু তাৰ পিছত আমি বিচৰা ধৰণে ব্যৱহাৰ কৰা। আমি সংখ্যাবোৰ নিম্নলিখিত ধৰণে ঘোষণা কৰিব পাৰোঁ।

Imagine that we need to use 100 such numbers. Shall we declare 100 integer varibles?

কল্পনা কৰক যে আমি এনে ১০০ টা সংখ্যা ব্যৱহাৰ কৰিব লাগিব। আমি 100 টা ইণ্টেগাৰ ভেৰিবল ঘোষণা কৰিম নেকি?

Answer is No! We have a much better way to handle this situation. Let study the concept of ”array” in this chapter that tackes that tackles this issue.

উত্তৰ হৈছে নহয়! এই পৰিস্থিতিটো মোকাবিলা কৰাৰ বাবে আমাৰ ওচৰত বহুত ভাল উপায় আছে। এই অধ্যায়ত ”এৰে”ৰ ধাৰণাটো অধ্যয়ন কৰিবলৈ দিয়ক যিয়ে এই সমস্যাটোৰ মোকাবিলা কৰে।