8.4 UNDERSTANDING THE C PROGRAM

8.4 চি প্ৰ’গ্ৰাম বুজা

Let us now try to understand the C program we wrote line by line. In the first line, we have included an existing file namely, stdio.h in the program we are writing. This is a header file (file extension is .h) and it provides support for standard input and output operations. The file contains definitions of many functions (such as printf(), scanf(), etc.) that we use in our program.

এতিয়া আমি শাৰী অনুসৰি লিখা চি প্ৰ’গ্ৰামটো বুজিবলৈ চেষ্টা কৰোঁ আহক। প্ৰথম শাৰীত, আমি লিখি থকা প্ৰ’গ্ৰামটোত এটা বিদ্যমান ফাইল অন্তৰ্ভুক্ত কৰিছোঁ, যেনে ষ্ট্ডিঅ’এইচ। এইটো এটা হেডাৰ ফাইল (ফাইল সম্প্ৰসাৰণ হৈছে .এইচ) আৰু ই মানক ইনপুট আৰু আউটপুট কাৰ্যৰ বাবে সমৰ্থন প্ৰদান কৰে। ফাইলটোত আমি আমাৰ প্ৰ’গ্ৰামত ব্যৱহাৰ কৰা বহুতো ফাংচনৰ সংজ্ঞা (যেনে প্ৰিণ্টফ(), স্কেনফ(), ইত্যাদি থাকে।

In addition to stdio.h, C programming language provides many other header files such as stdlib.h, math.h, string.h and others. We may also create header files from our side. Those will be called user defined header files.

ষ্ট্ডিঅ’এইচ-ৰ উপৰিও, চি প্ৰ’গ্ৰামিং ভাষাই আন বহুতো হেডাৰ ফাইল প্ৰদান কৰে যেনে ষ্ট্ৰেলিব.এইচ, গণিত.এইচ, ষ্ট্ৰিং.এইচ আৰু অন্যান্য। আমি আমাৰ ফালৰ পৰা হেডাৰ ফাইলও সৃষ্টি কৰিব পাৰোঁ। সেইবোৰক ব্যৱহাৰকাৰী নিৰ্ধাৰিত হেডাৰ ফাইল বুলি কোৱা হ’ব।

Whenever we write something with a double parentheses (), it indicates a function in a program. A function combines a set of statements within two curly braces {} for performing any specific work. The execution of any program starts from a special function main(). All C programs must have this function.

যেতিয়াই আমি ডাবল পেৰেনহাইছৰ সৈতে কিবা লিখোঁ (), ই প্ৰ’গ্ৰাম এটাত এটা ফাংচন সূচায়। এটা ফাংচনে যিকোনো নিৰ্দিষ্ট কাম কৰাৰ বাবে দুটা কোঁকড়া ব্ৰেছ {} ৰ ভিতৰত বিবৃতিৰ এটা ছেট একত্ৰিত কৰে। যিকোনো প্ৰ’গ্ৰামৰ কাৰ্যকৰীকৰণ এক বিশেষ ফাংচন মেইনৰ () পৰা আৰম্ভ হয়। সকলো চি প্ৰ’গ্ৰামৰ এই ফাংচন টো থাকিব লাগিব।

The next statement is the printing statement. Syntax of the language says if we want to print anything, we should write inside the built-in function printf(). This is used to send formatted output to the screen. The string to be printed is enclosed within double quotes.

পৰৱৰ্তী বিবৃতিটো হৈছে প্ৰিণ্টিং বিবৃতি। ভাষাৰ বাক্যবিন্যাসে কয় যে যদি আমি কিবা প্ৰিণ্ট কৰিব বিচাৰো, আমি বিল্ট-ইন ফাংচন প্ৰিণ্টফৰ ভিতৰত লিখিব লাগে।)। ইয়াক স্ক্ৰীণলৈ ফৰ্মেটেড আউটপুট প্ৰেৰণ কৰিবলৈ ব্যৱহাৰ কৰা হয়। মুদ্ৰণ কৰিব লগা স্ট্ৰিংটো দুটা উদ্ধৃতিৰ ভিতৰত আৱদ্ধ কৰা হৈছে।

We put a semicolon (;) at the end of this line. This indicates it is a statement and every statement in C programming language is to be ended with a semicolon.

আমি এটা ছেমিকলন ৰাখিছিলো (;) এই শাৰীৰ শেষত। ই সূচায় যে এইটো এটা বিবৃতি আৰু চি প্ৰগ্ৰামিং ভাষাৰ প্ৰতিটো বিবৃতি এটা ছেমিকলনৰ সৈতে সমাপ্ত কৰিব লাগিব।

The last statement in the program is a return. This is the last statement of the function main() too. Every function in a program has to return some value. As we have prefixed “int” with the function main(), the function should return any integer value (we will learn different types available in C in the next chapter).

কাৰ্যসূচীটোৰ অন্তিম বিবৃতিটো হৈছে ঘূৰি অহা। এইটো ফাংচন মেইনৰ অন্তিম বিবৃতি() । প্ৰ’গ্ৰাম এটাৰ প্ৰতিটো ফাংচনে কিছু মান ঘূৰাই দিব লাগিব। যিহেতু আমি ফাংচন মেইনৰ সৈতে “ইণ্ট” পূৰ্বনিৰ্ধাৰিত কৰিছোঁ(), ফাংচনটোৱে যিকোনো ইণ্টেগাৰ মান ঘূৰাই দিব লাগে (আমি পৰৱৰ্তী অধ্যায়ত চি-ত উপলব্ধ বিভিন্ন প্ৰকাৰ শিকিম)।