Functions in C | Chapter 7 | Class 10 Computer Science 571(NCERT) Question and Answer | Class 10 Computer Science 571(NCERT) Question and Answer Solution English Medium |


 Functions in C

Chapter 7 


Exercise

1. What is a global variable in C? Why do we need such a variable?

(চি-ত এক গোলকীয় পৰিৱৰ্তনশীল কি? আমাক এনে পৰিৱৰ্তনশীলৰ কিয় প্ৰয়োজন?)

Ans: A variable defined outside the range of all functions is known as a global variable in C. Global variables have a global range, so these variables can be input and modified by any function, structure, or any category C.

Variables are used to store references and information manipulated in a computer program. It also provides a way to label data with descriptive names so that our programs are readers and we can understand more clearly.

(সকলো ফাংচনৰ পৰিসৰৰ বাহিৰত নিৰ্ধাৰিত পৰিৱৰ্তনশীল এটাক চি-ত এক গোলকীয় চলক হিচাপে জনা যায়। গ্লোবেল ভেৰিয়েবলবোৰৰ এক গোলকীয় পৰিসৰ থাকে, সেয়েহে এই চলকবোৰ যিকোনো ফাংচন, গাঁথনি বা যিকোনো শ্ৰেণী চি-ৰ দ্বাৰা ইনপুট আৰু সংশোধন কৰিব পাৰি।

কম্পিউটাৰ প্ৰ'গ্ৰাম এটাত প্ৰসংগ আৰু তথ্য সংৰক্ষণ কৰিবলৈ চলকব্যৱহাৰ কৰা হয়। ই বৰ্ণনামূলক নামৰ সৈতে ডাটা লেবেল কৰাৰ এটা উপায়ও প্ৰদান কৰে যাতে আমাৰ কাৰ্যসূচীবোৰ পঢ়ুৱৈ হয় আৰু আমি অধিক স্পষ্টভাৱে বুজি পাওঁ।)

2. Write the syntax of a function declaration. The name of the function is calculateAge (). The function accepts the current year and birth year of a person. The function returns the age of the person.

(ফাংচন ঘোষণা এটাৰ বাক্যবিন্যাস লিখক। ফাংচনৰ নাম হৈছে গণনা কৰা()। ফাংচনটোৱে এজন ব্যক্তিৰ চলিত বৰ্ষ আৰু জন্ম বৰ্ষ গ্ৰহণ কৰে। ফাংচনটোৱে ব্যক্তিজনৰ বয়স ঘূৰাই দিয়ে।) 

Ans: A feature announcement tells the compiler about the function name and how to switch the function. The actual body of functions can be defined separately. maximum (Int., Inc.); A feature declaration is required when defining the function in one source file and when calling the function to another file.

Take the difference between the current year and the year of their birth: year = present year - year of birth.

Take the difference between the present month and the month of their birth: month = current month - month of birth.

The next dated function calculates a person's age.

(এটা ফিচাৰ ঘোষণাই কম্পাইলাৰক ফাংচন নাম আৰু ফাংচনটো কেনেদৰে সলনি কৰিব লাগে সেই বিষয়ে কয়। ফাংচনবোৰৰ প্ৰকৃত শৰীৰটো পৃথকে সংজ্ঞায়িত কৰিব পাৰি। সৰ্বাধিক (ইণ্ট,ইনক.); এটা উৎস ফাইলত ফাংচনটো নিৰ্ধাৰণ কৰোঁতে আৰু ফাংচনটো আন এটা ফাইললৈ কল কৰোঁতে এটা ফিচাৰ ঘোষণাৰ প্ৰয়োজন।

চলিত বৰ্ষ আৰু তেওঁলোকৰ জন্মৰ বছৰৰ মাজৰ পাৰ্থক্য লওঁক: বছৰ = বৰ্তমান বৰ্ষ - জন্মবৰ্ষ।

বৰ্তমান মাহ আৰু তেওঁলোকৰ জন্ম মাহৰ মাজৰ পাৰ্থক্য লওঁক: মাহ = চলিত মাহ - জন্ম মাহ।

পৰৱৰ্তী তাৰিখৰ ফাংচনে এজন ব্যক্তিৰ বয়স গণনা কৰে।)

3. Write the code segment for the function definition of the above function calculateAge.

(ওপৰোক্ত ফাংচন গণনাৰ ফাংচন সংজ্ঞাৰ বাবে কোড খণ্ডলিখক।)

Ans: Act with logic and returned values. This function has arguments and returns a value: ...

Works with logic and without return value. ...

Act without logic and with returned values. ...

Act without logic and without returned values.

Most usage guides will say that you want to talk about two people or things ('sitting between John and Carol') and more than two people or things ('students are talking among themselves').

(যুক্তি আৰু ঘূৰাই দিয়া মূল্যবোধৰ সৈতে কাম কৰক। এই ফাংচনৰ তৰ্ক আছে আৰু এটা মূল্য ঘূৰাই দিয়ে: ...

যুক্তিৰ সৈতে আৰু ঘূৰাই দিয়া মূল্য অবিহনে কাম কৰে। ...

যুক্তি অবিহনে আৰু ঘূৰাই দিয়া মূল্যৰ সৈতে কাম কৰক। ...

যুক্তি অবিহনে আৰু ঘূৰাই দিয়া মূল্যঅবিহনে কাম কৰক।

বেছিভাগ ব্যৱহাৰ গাইডে ক'ব যে আপুনি দুজন ব্যক্তি বা বস্তুৰ বিষয়ে কথা পাতিব বিচাৰে ('জন আৰু কেৰলৰ মাজত বহিআছে') আৰু দুটাতকৈ অধিক লোক বা বস্তুৰ বিষয়ে ('শিক্ষাৰ্থীসকলে নিজৰ মাজত কথা পাতি আছে')।

4. What are different types of functions in C ? Differentiate among them.

(চি-ত বিভিন্ন প্ৰকাৰৰ ফাংচন কি? সেইবোৰৰ মাজত পাৰ্থক্য কৰক।)

Ans: 

5. Differentiate between caller and callee functions, write a small C progarm and identify. the caller and callee function in it.

(কলাৰ আৰু কেলি ফাংচনৰ মাজত পাৰ্থক্য কৰক, সৰু চি প্ৰগাৰ্ম এটা লিখক আৰু চিনাক্ত কৰক। ফোন কৰা আৰু কলিয়ে ইয়াত কাম কৰে।)

Ans:  

6. When do we call a function user-defined? Is printf() a user-defined function? Justify.

(আমি কেতিয়া ফাংচন এটাক ব্যৱহাৰকাৰী-নিৰ্ধাৰিত বুলি কওঁ? প্ৰিণ্টফ() ব্যৱহাৰকাৰী-নিৰ্ধাৰিত ফাংচন নেকি? ন্যায়সঙ্গত।)

Ans: 

7. Can we have two functions with the same name but with different numbers of parameters in a single C program? Write a simple C program to justify your answer.

(আমি একে নামৰ দুটা ফাংচন কৰিব পাৰোঁ নেকি কিন্তু এটা চি প্ৰ'গ্ৰামত বিভিন্ন সংখ্যক প্ৰাচলৰ সৈতে? আপোনাৰ উত্তৰটো ন্যায়সঙ্গত কৰিবলৈ এটা সৰল চি প্ৰ'গ্ৰাম লিখক।)

Ans: 

8. What are different components of a function? Show with a complete C program.

(ফাংচন এটাৰ বিভিন্ন উপাদানবোৰ কি? এটা সম্পূৰ্ণ চি প্ৰ'গ্ৰামৰ সৈতে প্ৰদৰ্শন কৰক।)

Ans:  

9. Define recursive function. Can we use a recursive function to solve all kinds of problems?

( পুনৰাবৃত্তিমূলক ফাংচন নিৰ্ধাৰণ কৰক। আমি সকলো ধৰণৰ সমস্যা সমাধান কৰিবলৈ এটা পুনৰাবৃত্তিমূলক ফাংচন ব্যৱহাৰ কৰিব পাৰোঁনে?)

Ans: 

10. Consider the below code and list all the syntax errors.

(তলৰ কোডটো বিবেচনা কৰক আৰু সকলো বাক্যবিন্যাস ত্ৰুটি তালিকাভুক্ত কৰক।)

Ans: 









11. Consider the code segment below and find out the output if the user enters 5 from the keyboard when asked for.

(তলৰ কোড খণ্ডটো বিবেচনা কৰক আৰু যদি ব্যৱহাৰকাৰীয়ে বিচাৰিলে কীবৰ্ডৰ পৰা 5 প্ৰবিষ্ট কৰে তেন্তে আউটপুটটো বিচাৰি উলিয়াওক।)

Ans:  




 12. Write a C program and define a function square() that accepts a number as the parameter and returns the square of that number as output.

(এটা চি প্ৰ'গ্ৰাম লিখক আৰু এটা ফাংচন বৰ্গ () নিৰ্ধাৰণ কৰক যি এটা সংখ্যাক প্ৰাচল হিচাপে গ্ৰহণ কৰে আৰু সেই সংখ্যাৰ বৰ্গটো আউটপুট হিচাপে ঘূৰাই দিয়ে।)

Ans: 

13. Write a C program and define a function search () that searches an element in an array and returns the index of the element.

(এটা চি প্ৰ'গ্ৰাম লিখক আৰু এটা ফাংচন সন্ধান () নিৰ্ধাৰণ কৰক যি এটা এৰেত এটা উপাদান অনুসন্ধান কৰে আৰু উপাদানটোৰ সূচী ঘূৰাই দিয়ে।)

Ans:

14. Write a C program and define a recursive function to find the summation of first N natural numbers.

(চি প্ৰ'গ্ৰাম এটা লিখক আৰু প্ৰথম এন প্ৰাকৃতিক সংখ্যাবোৰৰ সংক্ষিপ্তকৰণ বিচাৰিবলৈ এটা পুনৰাবৃত্তিমূলক ফাংচন নিৰ্ধাৰণ কৰক।)

Ans: 

15. Write a C program and define a function add() that accepts three integers. These integers indicate indices of an integer array. The function returns the summation of the elements stored in those indices.

(এটা চি প্ৰ'গ্ৰাম লিখক আৰু তিনিটা পূৰ্ণসংখ্যা গ্ৰহণ কৰা ফাংচন যোগ () নিৰ্ধাৰণ কৰক। এই পূৰ্ণসংখ্যাবোৰে এটা ইণ্টেগাৰ এৰেৰ সূচক সূচায়। ফাংচনটোৱে সেই সূচকবোৰত সঞ্চিত উপাদানবোৰৰ সাৰাংশ ঘূৰাই দিয়ে।)





For example, if we call the function add( 0, 2, 5), the function will return 24. The output is formed by 7+ 8+ 9 because elements at indices 0, 2 and 5 are 7, 8 and 9 respectively.

(উদাহৰণ স্বৰূপে, যদি আমি ফাংচনটোক যোগ দিওঁ(0, 2, 5) কল কৰোঁ, ফাংচনটো 24 ঘূৰাই পাব। আউটপুট 7+ 8+ 9 ৰ দ্বাৰা গঠন কৰা হয় কিয়নো সূচক 0, 2 আৰু 5-ত উপাদানবোৰ ক্ৰমান্বয়ে 7, 8 আৰু 9 হয়।)

Ans:  

  

Type & Assamese Translate : Himashree Bora.







Post ID : DABP005297