UP Board Solutions for Class 10 Computer Science Chapter 10 String Data Manipulation

UP Board Solutions for Class 10 Computer Science Chapter 10 String Data Manipulation

String Data Manipulation Long Answer Type Questions (8 Marks)

Question 1.
What do you know about string function? Explain three-string functions with suitable examples.
Or
What is a string? Explain two string functions of your choice. (UP 2007, 08, 11, 12, 13)
Answer:
String Functions. String functions are those functions which (UPBoardSolutions.com) handle string data. ‘C’ language uses a large set of useful string handling library functions. Three string functions are:

1. STRCPY( ): This function copies the contents of one string into another. The base addresses of the source and target strings should be supplied to this function.
Example:

UP Board Solutions

void main()
{
char src[ ] = “Rajeev”;
char tgt[20];
strcpy (tgt, src);
printf (“Source string = %s”, src);
printf (“Target string = %s”, tgt);
}
Output:
Source string = Rajeev
Target string = Rajeev

2. STRLWR(): This function converts upper case (A to Z) string to all lower case (a to z).
Example:

void main()
{
char STR[ ] = “RAJEEV”;
printf (“Upper case = %s”, STR);
strlwr(STR);
printf(“lower case = %s”, STR);
}
Output:
Upper case = RAJEEV
Lower case = rajeev

3. STRUPR( ): This function converts lower case (a to z) string to upper case (A to Z) string:
Example:

UP Board Solutions

void main()
{
char str[ ] = “rajeev”;
prinft (“lower case = %S”, str);
strupr (str);
printf (“upper case = %S”, str);
}

Output:
Lower case = rajeev
Upper case = RAJEEV

Question 2.
Explain GETS() and PUTS() function with example.
Answer:
GETS( ): In ‘C’ scanf( ) is not capable of receiving a multiword string, therefore, names such as “Rajeev Sharma” would be unacceptable. The function collects a string of characters terminated by a new line, the (UPBoardSolutions.com) standard input.
PUTS(): The function puts() can display only one string at a time. Puts copies the null-terminated string to the standard output. Also on display a string, unlike printf(), puts() places the cursor on the next line.
Example:

void main()
{
char name [20];
printf (“enter your name");
gets (name);
puts (“Good Morning !”);
puts (name);
}

Output:
Enter your name, Rajeev Sharma
Good Morning
Rajeev Sharma.

UP Board Solutions

Question 3.
What is concatenation? Explain with example.
Or
Explain the mechanism of Concatenation of a new word in a string. (UP 2017)
Answer:
Concatenation: Concatenation means joining of two different strings to form one string. In ‘C’, streat function is used to do concatenation.
STRCAT(): This function appends or concatenates the source string (UPBoardSolutions.com) at the end of the target string. For example, “Rajeev” and “Sharma” on concatenation would result in a string “Rajeev Sharma”. The length of the resulting string is strlen(dest) + strlen(src).
Example:

void main()
{
char src[ ] = “Rajeev”;
char tgt[ ] = “Sharma”;
strcat (tgt, src);
printf (“\n source string = % s”, src);
printf (“\n target string = % s”, tgt);
}

Output:
source string = Rajeev
target string = Sharma Rajeev.

Question 4.
WAP to check for palindrome.
Answer:
Program:

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main()
{
char str[20);
char temp[20];
puts (“Enter any word”);
gets (str);
strcpy (temp, str);
strrev (str);
if (strcmp (str, temp) == 0)
{
printf (“it is a palindrome”);
}
else
{
printf (“it is not a palindrome”);
}
}

Question 5.
WAP to change a string from lower case to upper case.
Answer:
Program:

#include<stdio.h>
#include<conio.h>
#include void main()
{
char str [20];
puts (“enter a string in lower case”);
gets (str);
strupr (str);
printf (“upper case = %S”, str);
}

String Data Manipulation Short Answer Type Questions (4 Marks)

UP Board Solutions

Question 1.
What is strlen in ‘C’ language? (UP 2011)
Answer:
STRLEN( ): This function calculates the length of a string. It returns (UPBoardSolutions.com) the number of characters in a string, not counting the terminating null character. Its syntax is illustrated in the following program:

void main()
{
char N[ ] = “This is a book”;
int len;
len = strlen(N);
printf (“The length of the string is %d”, len);
}

Question 2.
What are the strings? (UP 2008, 18)
Answer:
Strings: Like a group of integers can be stored in an integer array, similarly a group of characters can be stored in a character array. Strings are single-dimensional arrays of type char. In ‘C’, a string is terminated by null character or ‘\0’. String constants are written in double-quotes.
For Example: **char name [ ] = {‘I’, ‘N’, ‘D’, ‘T’, ‘A’ , ‘\0’};
Each character in the array occupies one byte of memory and the last character is always ‘\0’.’\0′ is called null character. Note that ‘\0’ and ‘0’ are not the same. ASCII value of ‘\0’ is 0, whereas the ASCII value of ‘O’ is 48. Many string functions such as string length, string compare, string copy, string concatenate etc. are most commonly used functions.

UP Board Solutions

Question 3.
What is the purpose of strcmp function?
Answer:
Strcmp function. This function compares two strings to find out whether they are the same or different. The string comparison starts with the first character in each string and continues with subsequent characters until the (UPBoardSolutions.com) corresponding characters differ or until the end of the strings is reached. If the two strings are identical, strcmp () returns a value zero. If they are not, it returns the numeric difference between the ASCII values of the non-matching characters.
Example:

void main ()
{
char str 1 [ ] = “Rajeev”;
char str 2 [ ] = “Sharma”;
int i, j, k;
i = strcmp(str l, “Rajeev”);
j = strcmp (str l, str 2);
k = strcmp (str l, “Rajeev Sharma”);
printf (“\n % d %d % d”, i, j, k);
}

Output:
0 – 1 – 32

String Data Manipulation Very Short Answer Type Questions (2 Marks)

Question 1.
Which function is used to find the length of a string?
Answer:
strlen() function.

Question 2.
What is the name of the function which is used to copy a string into another?
Answer:
strcpy () function.

Question 3.
In ‘C’ language a string is terminated with what?
Answer:
In ‘C’ language a string is terminated by (UPBoardSolutions.com) null character or ‘10’.

UP Board Solutions

Question 4.
What is the ASCII value of ‘10’ and ‘0’?
Answer:
ASCII value of ‘10’ is 0. ASCII value of ‘0’ is 48.

Question 5.
The process of appending one string at the end of smother string is known as ………..
Answer:
Concatenation.

Question 6.
Function to check the time of the day. (UP 2012)
Answer:
time ( ).

String Data Manipulation Objective Type Questions (1 Mark)

There are four alternative answers for each part of the questions. Select the correct one and write in your answer book:

Question 1.
A variable name must start with:
(a) An alphabet
(b) A number
(c) $ symbol
(d) # sign
Answer:
(a) An alphabet

Question 2.
% is used for:
(a) String data type
(b) Character data type
(c) Numeric data type
(d) Float data type.
Answer:
(a) String data type

UP Board Solutions

Question 3.
Which header file is used for sesmf () and print ()?
(a) stdio.h
(b) conio.h
(d) math.h
(d) Both (a) and (b).
Answer:
(b) conio.h

Question 4.
Which of the following is not a looping statement?
(a) for
(b) if
(c) while
(d) do-while.
Answer:
(b) if

UP Board Solutions for Class 10 Computer Science

UP Board Solutions for Class 10 Computer Science Chapter 9 Functions and Sub-Routines

UP Board Solutions for Class 10 Computer Science Chapter 9 Functions and Sub-Routines

Functions and Sub-Routines Long Answer Type Questions (8 Marks)

Question 1.
What do you mean by function in ‘C’? (UP 2004, 08, 09, 10, 19)
Or
What is the library function in ‘C’? Explain. (UP 2010, 12, 18)
Answer:
Introduction: Sometimes, to perform a particular task in a program, you may have to write another program which may be a very cumbersome process. Functions are very useful to read, write, debug and modify (UPBoardSolutions.com) complex programs. They can also be easily incorporated in the main program. In ‘C’ language, main() itself is a function that means the main function is invoking the other functions to perform various tasks.
There are two types of functions:

UP Board Solutions

  1. Built-in functions/Library Function.
  2. User-defined functions.

1. Built-in Functions/Library Functions: These are the pre-defined routines that are included as an integral part of the language. Each function is accessed simply by stating its name, followed by whatever information must be supplied to the function, enclosed in parentheses (A numeric quantity or a string that is passed to a function in this manner is called an argument). Library functions are also called standard functions or elementary functions. These functions provide a quick and easy way to evaluate many mathematical (UPBoardSolutions.com) functions and to carry out certain logical operations.
There are several library functions in ‘C’ Language. Basic Library functions are of two types:

  • String Functions: String functions operate on strings, e.g., strlen (), strrev()
  • Numeric Functions: Numeric functions operate on numeric values, e.g., ABS(), EXP(), SIN(), cos().

2. User-defined Functions: This feature allows you to define functions within a program, which you can call whenever you need them. While running the program (FUNC) statement can save space as well time, as a complex calculation can be defined with a short name and called up by its name where needed.

UP Board Solutions

Question 2.
What are user-defined functions? Explain with example. (UP 2005, 13, 16)
Answer:
User-defined Functions: This feature allows you to define functions within a program, which you can call whenever you need them. While running the program (FUNC) statement can save space as well as time, as a complex calculation can be defined with a short name and called up by its name where needed.
Defining a Function

main()
{
printf (“I am in function main \n”);
India();
printf (“I am finally back in function main \n”);
}
India()
{
printf (“I am in India \n”);
Delhi();
printf (“I am back in India \n”);
1
Delhi();
{
printf (“I am in Delhi \n”);
Bombay();
}
Bombay()
{
printf (“I am in Bombay”);
}

UP Board Solutions

Output:
I am in function main
I am in India
I am in Delhi
I am in Bombay
I am back in India
I am finally back in function main

Question 3.
WAP to demonstrate a function declaration, function calling and function definition.
Answer:
Program:

#include<stdio.h>
void main (void)
{
void display (void); /* function declaration */ display (); /* function calling */
}
void display (void)/* function definition */
{
printf (“this is a test program \n”);
printf (“for demonstrating a function call \n”);
printf (“in C \n”);
}

Output:
this is a test program for demonstrating a function call in C

Question 4.
Explain Return statement with example.
Answer:
Return Statement: The keyword return is used to terminate function and return a value to its caller. The return statement may also be used to exit a function without returning a value. The return statement may or may (UPBoardSolutions.com) not include an expression.
Example Program:

UP Board Solutions

# include<stdio.h>
void main (void)
{
float max (float, float, float);
float a, b, c maximum;
printf (“Enter three numbers\n”);
scanf (“%d %d %d”, &a, &b &c);
maximum = max (a, b, c);
printf(“maximum = %d, maximum);
}
float max (float x, float y, float z)
}
if (x > y)
{
if (x > z)
return (x);
}
else
{
if (y > z)
return (z);
else
return (z);
}
}

Output:
Enter three numbers
2 4 8
maximum = 8

Functions and Sub-Routines Short Answer Type Questions (4 Marks)

Question 1.
What is the status of ‘C’ language? Why is ‘C’ language so popular in the software world? Explain. (UP 2011, 15, 18, 19)
Or
Why is ‘C’ a very popular language? Explain with suitable example. (UP 2017)
Answer:
Programming Language is a set of instructions and keywords which help a user to communicate with the computer. The ‘C’ programming language was developed by Dennis Ritchie in Bell Telephone Laboratories, in the (UPBoardSolutions.com) early 1970s. Ken Thompson and his team supported him in developing this language. In the late seventies, ‘C’ began to replace the more familiar languages of that time like PL/I, ALGOL, etc. In less than a decade of its introduction, ‘C’ has become a language of choice for software professionals because it is reliable, simple and easy to use. The UNIX operating system was written in ‘C’ language.

UP Board Solutions

One of the most interesting things about the ‘C’ language is that its compiler is written in ‘C’. ‘C’ language is considered as a middle-level language since it was designed to have both a relatively good programming efficiency and a relatively good machine efficiency. It is a bridge between low level and high-level languages.

  • ‘C’ language possesses features of both low level and high-level languages.
  • It provides the facility to do programming with easy approaches.
  • It provides the facility to do programming at register level which leads to fast processing.
  • It consists of simple English like commands, which are easy to understand.
  • The programs written in ‘C’ language are 100 per cent efficient and are also machine-independent and portable.
  • A ‘C’ program is easier to write and does not vary much from computer to computer.

Question 2.
Define ABS function with example.
Answer:
ABS(X): This function gives the absolute value of X. The absolute value (UPBoardSolutions.com) of a constant is always independent of its sign le., it is always positive.
For example:

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main()
{
int a = -20, b = -20.23, c = 18.5
printf (“%d %d %d”, abs(a), abs(b), abs(c));}

Output: 20 20.23 18.5

Question 3.
Define SQR function with example.
Answer:
SQR(X): function returns the square root of its argument which should never be negative.
For example:

#include<stdio.h>
#include<conio.h>
void main()
{
int a = 4, b;
b = sqr(a);
printf (“%d”, b);
}

Output: 2

UP Board Solutions

Functions and Sub-Routines Very Short Answer Type Questions (2 Marks)

Question 1.
What is argument?
Answer:
The value we pass in a function at the time of its calling is known as an argument.

Question 2.
What is Numeric function? (UP 2016)
Answer:
The numeric function works on numeric values.

Question 3.
What is the use of EXP function?
Answer:
EXP function is used to return the exponential value of the argument.

Question 4.
What is the other name of the pre-defined function?
Answer:
The pre-defined function is also known as built-in function.

UP Board Solutions

Question 5.
Who developed ‘C’ language?
Answer:
Dennis Ritchie and Ken Thompson.

Question 6.
A loop within a loop is known as ……..
Answer:
Nested loop.

Functions and Sub-Routines Objective Type Questions (1 Marks)

There are four alternative answers for each part of the questions. Select (UPBoardSolutions.com) the correct one and write in your answer book:

Question 1.
Functions which are compiled into object modules are known as (UP 2012)
(a) Library functions
(b) Recursive functions
(c) User-defined functions
(d) None of these.
Answer:
(a) Library functions

UP Board Solutions

Question 2.
The default return type of a user-defined function is:
(a) void
(b) float
(c) char
(d) int
Answer:
(a) void

Question 3.
A user-defined function can be called:
(a) One time
(b) Two times
(c) Three times
(d) More than three times.
Answer:
(d) More than three times.

Question 4.
Language used to design web pages is: (UP 2014)
(a) C++
(b) BASIC
(c) HTML
(d) JAVA.
Answer:
(c) HTML

Question 5.
The value passed at the time of calling a function is known as:
(a) Variables
(b) Constants
(c) Arguments
(d) None of these.
Answer:
(c) Arguments

UP Board Solutions

Question 6.
Which of the following is short-cut for ‘Save’ operation?
(a) Control + P
(b) Control + S
(c) Control + N
(d) Control + F
Answer:
(b) Control + S

UP Board Solutions for Class 10 Computer Science

UP Board Class 12 Geography Practical Work Chapter 1 Data: Its Source and Compilation

UP Board Solutions for Class 12 Geography Practical Work Chapter 1 Data: Its Source and Compilation (आंकड़े-स्रोत और संकलन)

UP Board Class 12 Geography Chapter 1 Text Book Questions

UP Board Class 12 Geography Chapter 1 पाठ्यपुस्तक के अभ्यास प्रश्नोत्तर

प्रश्न 1.
नीचे दिए गए चार विकल्पों में से सही उत्तर चुनिए
(i) एक संख्या अथवा लक्षण जो मापन को प्रदर्शित करता है, कहते हैं
(क) अंक
(ख) आँकड़े
(ग) संख्या
(घ) लक्षण।
उत्तर:
(ख) आँकड़े।

(ii) एकल आधार सामग्री एकमात्र माप है
(क) तालिका
(ख) आवृत्ति
(ग) वास्तविक संसार
(घ) सूचना।
उत्तर:
(क) तालिका।

(iii) एक मिलान चिह्न में, फोर एवं क्रॉसिंग फिफ्थ द्वारा समूहीकरण को कहते हैं
(क) फोर एंड क्रॉस विधि
(ख) मिलान चिह्न विधि
(ग) आवृत्ति अंकित विधि
(घ) समावेश विधि।
उत्तर:
(क) फोर एंड क्रॉस विधि।

(iv) ओजाइव एक विधि है जिसमें
(क) साधारण आवृत्ति नापी जाती है
(ख) संचयी आवृत्ति नापी जाती है
(ग) साधारण आवृत्ति अंकित की जाती है
(घ) संचयी आवृत्ति अंकित की जाती है।
उत्तर:
(ख) संचयी आवृत्ति नापी जाती है।

(v) यदि वर्ग के दोनों अन्त आवृत्ति समूह में लिए गए हों, इसे कहते हैं
(क) बहिष्कार विधि
(ख) समावेशी विधि
(ग) चिह्न विधि
(घ) सांख्यिकीय विधि।
उत्तर:
(ख) समावेशी विधि।

प्रश्न 2.
निम्नलिखित प्रश्नों के उत्तर लगभग 30 शब्दों में दीजिए
(i) आँकड़ा और सूचना के बीच अन्तर।
उत्तर:
आँकड़ा- आँकड़ों को ऐसी संख्याओं के रूप में परिभाषित किया गया है जो यथार्थ विश्व के मापन को प्रदर्शित करती हैं।
सूचना- सूचना को एक प्रश्न के अर्थपूर्ण उत्तर अथवा अर्थपूर्ण उद्दीपक के रूप में परिभाषित किया गया है जिसे अगले प्रश्नों में सोपानित किया जा सकता है।

(ii) आँकड़ों से आप क्या समझते हैं?
उत्तर:
आँकड़ों को ऐसी संख्याओं के रूप में परिभाषित किया गया है जो यथार्थ विश्व के मापन को प्रदर्शित करती हैं।

(iii) एक तालिका में पाद टिप्पणी से क्या लाभ हैं?
उत्तर:
तालिका में दी गई पाद टिप्पणी से लाभ यह है कि उससे तालिका के स्रोत की जानकारी हो जाती है तथा अन्य संकेतों का पता चलता है।

(iv) आँकड़ों के प्राथमिक स्रोतों से आपका क्या तात्पर्य है?
उत्तर:
जो आँकड़े प्रथम बार व्यक्तिगत रूप से अथवा व्यक्तियों के समूह/संस्था अथवा संगठन द्वारा एकत्रित किए जाते हैं, आँकड़ों के प्राथमिक स्रोत कहलाते हैं।

(v) द्वितीयक आँकड़ों के पाँच स्रोत बताइए।
उत्तर:
द्वितीयक आँकड़ों के पाँच स्रोत हैं

  1. सरकारी प्रकाशन
  2. अर्द्ध-सरकारी प्रकाशन
  3. अन्तर्राष्ट्रीय प्रकाशन
  4. निजी प्रकाशन एवं
  5. समाचार-पत्र और पत्रिकाएँ।

(vi) आवृत्ति वर्गीकरण की अपवर्जी विधि क्या है?
उत्तर:
आवृत्ति वर्गीकरण की अपवर्जी विधि में एक वर्ग के उच्च मूल्य को उसी वर्ग में शामिल किया जाता है।

प्रश्न 3.
निम्नलिखित प्रश्नों के उत्तर लगभग 125 शब्दों में दीजिए
(i) राष्ट्रीय और अन्तर्राष्ट्रीय अभिकरणों की चर्चा कीजिए जहाँ से द्वितीयक आँकड़े एकत्र किए जा सकते हैं।
उत्तर:
राष्ट्रीय और अन्तर्राष्ट्रीय अभिकरण निम्नलिखित हैं जहाँ से द्वितीयक आँकड़े एकत्र किए जा सकते हैं
(1) सरकारी प्रकाशन- केन्द्र सरकार तथा राज्य सरकारों के अनेक मंत्रालय तथा विभाग और जिलों के बुलेटिन द्वितीय सूचनाओं के महत्त्वपूर्ण साधन हैं।
इनमें महत्त्वपूर्ण द्वितीय वर्ग की सूचनाएँ मिलती हैं। इसमें भारत के महापंजीयक कार्यालय द्वारा प्रकाशित भारत की जनगणना, राष्ट्रीय प्रतिदर्श सर्वेक्षण की रिपोर्टे, भारतीय मौसम विज्ञान विभाग की मौसम रिपोर्ट, राज्य सरकारों द्वारा प्रकाशित सांख्यिकीय सारांश और विभिन्न आयोगों द्वारा प्रकाशित आवधिक रिपोर्ट शामिल की जाती हैं।

(2) अर्द्ध-सरकारी प्रकाशन- इनमें नगर विकास प्राधिकरणों और विभिन्न नगरों और शहरों के नगर-निगमों और जिला परिषदों के प्रकाशन और रिपोर्ट आते हैं।

(3) अन्तर्राष्ट्रीय प्रकाशन- इसमें वार्षिकी, संयुक्त राष्ट्र के विभिन्न अभिकरणों; जैसे—संयुक्त राष्ट्र, अभिकरण, वैज्ञानिक तथा सांस्कृतिक संगठन, संयुक्त राष्ट्र विकास कार्यक्रम, विश्व स्वास्थ्य संगठन, खाद्य व कृषि परिषद् आदि द्वारा प्रकाशित रिपोर्ट और मोनोग्राफ शामिल किए जाते हैं। संयुक्त राष्ट्र के कुछ महत्त्वपूर्ण आवधिक प्रकाशन भी हैं जिनमें डैमोग्राफिक इयर बुक, स्टेटिस्टीकल इयर बुक और मानव विकास रिपोर्ट आदि महत्त्वपूर्ण हैं।

(ii) सूचकांक का क्या महत्त्व है? सूचकांक की परिकलन की प्रक्रिया को बताने के लिए एक उदाहरण लीजिए और परिवर्तनों को दिखाइए।
उत्तर:
सूचकांक- सूचकांक चर अथवा एक सांख्यिकीय माप है, जिसे चर अथवा समय भौगोलिक स्थिति या दूसरी विशेषताओं के सन्दर्भ में सम्बन्धित चरों के सम्बन्धित समूह में परिवर्तन को दर्शाने के लिए अभिकल्पित किया जाता है। सूचकांक का महत्त्व
सूचकांक का निम्नलिखित महत्त्व है
(1) सूचकांक न केवल समय के साथ हुए परिवर्तनों की माप करता है बल्कि विभिन्न स्थानों, उद्योगों, नगरों अथवा देशों की आर्थिक दशाओं की तुलना भी करता है।

(2) सूचकांक का उपयोग व्यापक रूप में अर्थशास्त्र और व्यवसाय में लागत और मात्रा में आए परिवर्तनों को देखने के लिए किया जाता है।
सूचकांक के परिकलन के लिए साधारण समुच्चय विधि सर्वाधिक उपयोगी है। इसका सूत्र निम्नलिखित
[latex]\frac{\Sigma q_{1}}{\Sigma q_{0}}[/latex] × 100
Σq1 = वर्तमान वर्ष के उत्पादन का योग
Σq0 = आधार वर्ष के उत्पादन का योग
उदाहरण— निम्न तालिका में भारत में लौह इस्पात के उत्पादन और 1980-81 से 2010-11 तक के सूचकांकों के परिवर्तन को दर्शाती
UP Board Class 12 Geography Practical Work Chapter 1 Data Its Source and Compilation 1

क्रियाकलाप

प्रश्न 1.
भूगोल की 35 विद्यार्थियों की कक्षा में, निम्नलिखित अंक 10 अंक के यूनिट टेस्ट में प्राप्त किए हैं
1, 0, 2, 3, 4, 5, 6, 7, 2, 3, 4, 0, 2, 5, 8, 4, 5, 3, 6, 3, 2, 7, 6, 5, 4, 3, 7, 8, 9, 7, 9, 4, 5, 4, 3 आँकड़े को संचयी आवृत्ति वितरण में प्रस्तुत कीजिए।
हल:
वर्गीकरण
UP Board Class 12 Geography Practical Work Chapter 1 Data Its Source and Compilation 2

प्रश्न 2.
अपनी कक्षा के भूगोल विषय की अन्तिम परीक्षा का परिणाम एकत्र कीजिए और प्राप्तांकों को संचयी आवृत्ति वितरण के रूप में प्रदर्शित कीजिए।
उत्तर:
नोट-छात्र स्वयं करें।

UP Board Class 12 Geography Chapter 1 Other Important Questions

UP Board Class 12 Geography Chapter 1 अन्य महत्त्वपूर्ण प्रश्नोत्तर

विस्तृत उत्तरीय प्रश्नोत्तर

प्रश्न 1.
साक्षात्कार लेते समय बरती जाने वाली सावधानियों का वर्णन कीजिए।
उत्तर:
साक्षात्कार लेते समय बरती जाने वाली सावधानियाँ-साक्षात्कार लेते समय शोधकर्ता के लिए निम्नलिखित बातों का ध्यान रखना आवश्यक है

  • जिस व्यक्ति का साक्षात्कार लेना है उसके साथ मैत्रीपूर्वक मेलजोल स्थापित करना चाहिए।
  • प्राप्त की जाने वाली सूचना की परिशुद्ध सूची बना लेनी चाहिए।
  • अपने सर्वेक्षण के उद्देश्य की स्पष्ट जानकारी देनी चाहिए और कोई झूठा वादा नहीं करना चाहिए।
  • उत्तर देने वाले से उसके परिवार की कुशलता के विषय में बातचीत करने से काम आसान हो जाएगा।
  • संवेदनशील प्रश्न पूछने से पहले उत्तर देने वाले व्यक्ति को विश्वास में ले लेना चाहिए।
  • प्रश्नों की भाषा सरल व शिष्ट होनी चाहिए।
  • जब उत्तरदाता व्यस्त हो तो उससे प्रश्न नहीं पूछना चाहिए।
  • उत्तरंदाता के आत्मसम्मान और धार्मिक भावना को ठेस पहुँचाने वाले प्रश्न नहीं पूछे जाने चाहिए।
  • उत्तरदाता से प्राप्त उत्तर को तुरन्त नोट कर लिया जाना चाहिए।
  • साक्षात्कार के बाद उत्तरदाता को धन्यवाद अवश्य देना चाहिए।

प्रश्न 2.
प्राथमिक व द्वितीयक आँकड़ों की विशेषताएँ बताइए।
उत्तर:
प्राथमिक व द्वितीयक आँकड़ों की विशेषताएँ निम्नलिखित हैं
प्राथमिक आँकड़ों की विशेषताएँ

  1. ये आँकड़े विस्तृत क्षेत्र और विस्तृत जानकारी के लिए उपयुक्त हैं।
  2. इन आँकड़ों के अध्ययन में लचीलापन होता है।
  3. इनके द्वारा गुप्त सूचनाएँ एकत्रित की जा सकती हैं।
  4. ये आँकड़े विश्वसनीय होते हैं।
  5. इन आँकड़ों को एकत्रित करने में समय व धन अपेक्षाकृत अधिक लगता है।
  6. व्यवस्थित ढंग व पूर्ण निर्धारित उद्देश्य से संकलित ये आँकड़े उपयोगी होते हैं।
  7. इन आँकड़ों का उपयोग करते समय विशेष ध्यान देने की आवश्यकता नहीं होती।

द्वितीयक आँकड़ों की विशेषताएँ

  1. द्वितीयक आँकड़े मौलिक नहीं होते, क्योंकि अनुसन्धानकर्ता अन्य एजेन्सियों द्वारा एकत्रित आँकड़ों का प्रयोग करते हैं।
  2. इन आँकड़ों के संकलन में समय, श्रम व धन अपेक्षाकृत कम लगता है।
  3. ये आँकड़े उपयोगी हो भी सकते हैं और नहीं भी।
  4. द्वितीयक आँकड़ों का प्रयोग अत्यन्त सावधानी से करना चाहिए।
  5. विस्तृत क्षेत्र व विस्तृत जानकारी के लिए उपयुक्त नहीं है।
  6. ये आँकड़े विश्वसनीय नहीं होते हैं।
  7. इन आँकड़ों का उपयोग करते समय विशेष सावधानी बरतने की आवश्यकता होती है।

प्रश्न 3.
प्राथमिक आँकड़ों के साधनों का विस्तृत वर्णन कीजिए।
उत्तर:
प्राथमिक आँकड़ों के साधन प्राथमिक आँकड़ों के साधन हैं— व्यक्तिगत प्रेक्षण, साक्षात्कार, प्रश्नावली अथवा अनुसूची एवं अन्य विधियाँ।
1. व्यक्तिगत प्रेक्षण- इस विधि में किसी व्यक्ति या व्यक्तियों के समूह द्वारा क्षेत्र में प्रत्यक्ष प्रेक्षण द्वारा आँकड़े एकत्रित किए जाते हैं। प्रेक्षक स्वयं क्षेत्र में जाकर सूचनाएँ एकत्रित करता है। प्रेक्षणकर्ता को विषय का सैद्धान्तिक ज्ञान होना आवश्यक है, ताकि मूल्यांकन वैज्ञानिक एवं निष्पक्ष हो सके।

2. साक्षात्कार- इस विधि में शोधकर्ता उत्तर देने वाले व्यक्ति के साथ प्रत्यक्ष सम्पर्क स्थापित करता है और संवाद तथा बातचीत द्वारा सूचनाएँ अथवा आँकड़े प्राप्त करता है।

3. प्रश्नावली- इस विधि में वांछित सूचना से सम्बन्धित साधारण प्रश्नों को उनके सम्भावित उत्तरों के साथ एक सादे कागज पर लिखा जाता है और उत्तर देने वाले व्यक्ति को दिए गए विकल्पों में सही उत्तर पर निशान लगाने को कहा जाता है।

4. अनुसूची- अनुसूची लगभग प्रश्नावली जैसी ही होती है, क्योंकि इसमें भी जाँच-पड़ताल से सम्बन्धित प्रश्न दिए हुए होते हैं। इन दोनों में अन्तर केवल यह है कि प्रश्नावली में उत्तर देने वाला प्रश्नावलियों को स्वयं भरता है, जबकि अनुसूची में परिगणक उत्तर देने वाले से प्रश्न पूछकर स्वयं भरता है।

5. अन्य विधियाँ- उपर्युक्त विधियों के अलावा कुछ अन्य विधियों की सहायता से भी आँकड़े एकत्रित किए जा सकते हैं।

लघ उत्तरीय प्रश्नोत्तर

प्रश्न 1.
समावेशी विधि से आप क्या समझते हैं?
उत्तर:
समावेशी विधि-समावेशी विधि में एक मूल्य जो वर्ग की उच्च सीमा के मूल्य के समान होता है, उसे उसी वर्ग में रखा जाता है; इसीलिए इस विधि को ‘समावेशी विधि’ कहते हैं। इस विधि में वर्गों को अलग प्रकार से प्रदर्शित किया जाता है। साधारणतया वर्ग की उच्च सीमा में अगले वर्ग की निम्न सीमा से 1 का अंतर होता है। महत्त्वपूर्ण बात यह है कि इस विधि में वर्ग का विस्तार 10 इकाइयों तक होता है।.

प्रश्न 2.
ओजाइव क्या है?
उत्तर:
ओजाइव-जब आवृत्ति को जोड़ दिया जाता है, उन्हें संचयी आवृत्ति कहा जाता है और जिस सारणी में सूचीगत किए जाते हैं, उसे संचयी आवृत्ति सारणी कहते हैं। संचयी आवृत्ति द्वारा प्राप्त किए गए वक्र को ‘ओजाइव’ कहते हैं। इसका निर्माण या तो कमतर विधि या अधिकतर विधि द्वारा करते हैं।

प्रश्न 3.
सूचकांक से क्या अभिप्राय है?
उत्तर:
सूचकांक-सूचकांक चर अथवा एक सांख्यिकीय माप है जिसे चर अथवा समय भौगोलिक स्थिति या दूसरी विशेषताओं के सन्दर्भ में सम्बन्धित चरों के सम्बन्धित समूह में परिवर्तन को दर्शाने के लिए अभिकल्पित किया जाता है। सूचकांक न केवल समय के साथ हुए परिवर्तनों की माप करता है बल्कि विभिन्न स्थानों, उद्योगों, नगरों अथवा देशों की आर्थिक दशाओं की तुलना भी करता है।

प्रश्न 4.
प्राथमिक आँकड़े को स्पष्ट कीजिए।
उत्तर:
प्राथमिक आँकड़े-वे आँकड़े जो क्षेत्र से सीधे किसी तत्त्व की गणना द्वारा अथवा लोगों से साक्षात्कार करके प्राप्त किए जाते हैं, उन्हें प्राथमिक आँकड़े’ कहते हैं। प्राथमिक आँकड़ों का मुख्य स्रोत सर्वेक्षण होता है। ये आँकड़े प्रथम बार व्यक्तिगत रूप से अथवा व्यक्तियों के समूह, संस्था/संगठन आदि द्वारा एकत्रित किए जाते हैं।
उदाहरणत- किसी कारखाने में कर्मचारियों की आय या किसी गाँव में भू-उपयोग से सम्बन्धित आँकड़े इत्यादि।

प्रश्न 5.
द्वितीयक आँकड़े को स्पष्ट कीजिए।
उत्तर:
द्वितीयक आँकड़े-द्वितीयक आँकड़े प्रयोगकर्ता द्वारा स्वयं एकत्रित नहीं किए जाते हैं। ये बहुधा प्रकाशित होते हैं। कई बार अप्रकाशित साधनों से भी द्वितीयक आँकड़े प्राप्त किए जाते हैं। प्रयोगकर्ता ऐसे आँकड़ों को लेकर उन्हें सही व विश्वसनीय मानते हुए अपना निष्कर्ष निकालते हैं।

प्रश्न 6.
सारणीयन के उद्देश्यों को समझाइए।
उत्तर:
सारणीयन के निम्नलिखित उद्देश्य हैं

  • सारणीयन का प्रमुख उद्देश्य अनुसन्धान द्वारा प्राप्त सामग्री को व्यवस्थित रूप से प्रस्तुत करना है।
  • सारणीयन से बोधगम्य सूचनाएँ प्राप्त की जाती हैं।
  • संकलित सामग्री को स्पष्ट करने के लिए उन्हें सारणियों के रूप में प्रस्तुत किया जाता है।
  • सारणीयन से तुलना करना, निष्कर्ष निकालना एवं व्याख्या करना आसान हो जाता है।
  • सारणीयन का उद्देश्य तथ्यों को संक्षिप्त रूप से प्रदर्शित करना है।

प्रश्न 7.
सारणीयन के लाभों पर प्रकाश डालिए।
उत्तर:
सारणीयन के निम्नलिखित लाभ हैं

  1. सारणीयन से अंकों की गणना आदि करने में आसानी रहती है।
  2. सारणीयन से तुलनात्मक अध्ययन करने में सुविधा रहती है।
  3. सारणीयन से समय व स्थान की बचत होती है।
  4. सारणीयन से तथ्यों का व्यवस्थित क्रम रहता है।
  5. सारणीयन से स्मरण करने में आसानी रहती है।
  6. सारणीयन सूचनाओं का स्पष्ट चित्र है।

प्रश्न 8.
सूचकांक की उपयोगिता एवं महत्त्व पर प्रकाश डालिए।
उत्तर:
सूचकांक की उपयोगिता एवं महत्त्व निम्नलिखित हैं

  1. सूचकांक की उपयोगिता सार्वभौमिक है।
  2. सूचकांक से जटिल तथ्यों का सरलीकरण हो जाता है।
  3. सूचकांक नीति-निर्माण में सहायक है।
  4. सूचकांक तुलना में सहायक है।
  5. सूचकांक भावी प्रवृत्तियों के संकेत हैं।

प्रश्न 9.
साक्षात्कार प्रविधि का महत्त्व समझाइए।
उत्तर:
साक्षात्कार प्रविधि का महत्त्व निम्नलिखित है

  1. साक्षात्कार से सभी प्रकार की सूचनाओं का संकलन होता है।
  2. इससे भूतकालीन घटनाओं का अध्ययन होता है।
  3. यह परस्पर प्रेरणात्मक अध्ययन है।
  4. यह एक मनोवैज्ञानिक अध्ययन है।
  5. यह अमूर्त-अदृश्य घटनाओं का अध्ययन है।
  6. इसमें सत्यापन की क्षमता होती है।

प्रश्न 10.
साक्षात्कार प्रविधि की सीमाएँ बताइए।
उत्तर:
साक्षात्कार प्रविधि की सीमाएँ निम्नलिखित हैं

  1. साक्षात्कार में सूचनादाता पर निर्भरता होती है।
  2. इसमें व्यक्तिगत पक्षपात की सम्भावना रहती है।
  3. इसमें स्मरण शक्ति पर निर्भरता होती है।
  4. सूचनादाता द्वारा गलत सूचना देने की सम्भावना रहती है।
  5. यह एक महँगी विधि है।
  6. यह बड़े अध्ययन क्षेत्र के लिए अनुपयुक्त है।

मौखिक प्रश्नों के उत्तर

प्रश्न 1.
आँकड़ों से क्या अभिप्राय है?
उत्तर:
किसी लक्षण के सम्बन्ध में प्राप्त मात्रात्मक सूचनाओं को, जो स्थान, समय या दशा से जुड़ी हुई होती हैं, ‘आँकड़े’ कहलाती हैं।

प्रश्न 2.
प्राथमिक व द्वितीयक आँकड़ों में क्या अन्तर है?
उत्तर:
जब शोधकर्ता स्वयं क्षेत्र में या आँकड़ों के स्रोत पर पहुँचकर मात्रात्मक सूचनाएँ प्राप्त करता है तो उन्हें ‘प्राथमिक आँकड़े’ कहते हैं। सरकारी, अर्द्ध-सरकारी, व्यक्तिगत प्रकाशनों तथा पत्र-पत्रिकाओं, रिपोर्टों से प्राप्त आँकड़े ‘द्वितीयक आँकड़े’ कहलाते हैं।

प्रश्न 3.
प्राथमिक आँकड़ों को एकत्रित करने के स्रोतों के नाम बताइए।
उत्तर:

  1. प्रत्यक्ष व्यक्तिगत साक्षात्कार द्वारा
  2. अप्रत्यक्ष व्यक्तिगत साक्षात्कार द्वारा
  3. संवाददाताओं से प्राप्त सूचना
  4. डाक द्वारा प्रश्नावली भेजकर
  5. परिगणकों द्वारा प्रश्नावली भेजकर।

प्रश्न 4.
निरपेक्ष आँकड़ा क्या है?
उत्तर:
जब आँकड़े अपने मूल रूप में पूर्णांक की तरह प्रस्तुत किए जाते हैं, उन्हें ‘निरपेक्ष आँकड़े’ (कच्चे आँकड़े) कहा जाता है।

प्रश्न 5.
द्वितीयक आँकड़ों के स्रोतों के नाम बताइए।
उत्तर:
द्वितीयक आँकड़ों के दो स्रोत हैं
(1) प्रकाशित एवं
(2) अप्रकाशित स्रोत।

1. प्रकाशित एवं

  • सरकारी प्रकाशन
  • अर्द्ध-सरकारी प्रकाशन
  • अन्तर्राष्ट्रीय प्रकाशन
  • निजी प्रकाशन
  • समाचार-पत्र और पत्रिकाएँ
  • इलेक्ट्रॉनिक।

2. अप्रकाशित स्रोत

  • सरकारी प्रलेख
  • अर्द्ध-सरकारी प्रलेख
  • निजी प्रलेख।

प्रश्न 6.
प्राथमिक आँकड़ों के साधनों के नाम बताइए।
उत्तर:
प्राथमिक आँकड़ों के साधन

  1. व्यक्तिगत प्रेक्षण
  2. साक्षात्कार
  3. प्रश्नावली व अनुसूची एवं
  4. अन्य विधियाँ।

प्रश्न 7.
आवृत्ति किसे कहते हैं?
उत्तर:
मदों की संख्याएँ ‘आवृत्ति’ कहलाती हैं।

प्रश्न 8.
संचयी आवृत्ति को किससे प्रदर्शित करते हैं?
उत्तर:
संचयी आवृत्ति को cf से प्रदर्शित करते हैं।

प्रश्न 9.
समूहों या वर्गों को तैयार करने के लिए लाई जाने वाली विधियों के नाम बताइए।
उत्तर:

  • अपवर्ती विधि एवं
  • समावेशी विधि।

प्रश्न 10.
आवृत्ति बहुभुज किसे कहते हैं?
उत्तर:
आवृत्तियों के वितरण का ग्राफ ‘आवृत्ति बहुभुज’ के नाम से जाना जाता है।

बहुविकल्पीय प्रश्नोत्तर

प्रश्न 1.
आँकड़े एकत्रित करने के स्रोत हैं
(a) दो
(b) तीन
(c) चार
(d) पाँच।
उत्तर:
(a) दो।

प्रश्न 2.
प्राथमिक आँकड़ों का साधन नहीं है
(a) साक्षात्कार
(b) प्रश्नावली
(c) अनुसूची
(d) सरकारी प्रकाशन।
उत्तर:
(d) सरकारी प्रकाशन।

प्रश्न 3.
आँकड़ों के द्वितीयक स्रोत का अप्रकाशित साधन है
(a) सरकारी प्रलेख
(b) अर्द्धसरकारी प्रलेख
(c) निजी प्रलेख
(d) उपर्युक्त सभी।
उत्तर:
(d) उपर्युक्त सभी।

प्रश्न 4.
साधारण आवृत्ति को प्रदर्शित करने वाला संकेताक्षर है
(a)f
(b) cf
(c) s
(d) t.
उत्तर:
(a) f.

प्रश्न 5.
समूहों या वर्गों को तैयार करने के लिए कौन-सी विधि प्रयोग में लायी जाती है
(a) समावेशी विधि
(b) अपवर्जी विधि
(c) (a) व (b) दोनों
(d) इनमें से कोई नहीं।
उत्तर:
(c) (a) व (b) दोनों।

UP Board Solutions for Class 12 Geography

UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables

UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables

Subscripted Variables Long Answer Type Questions (8 Marks)

Question 1.
What are subscripted variables? What is an Array? Explain. (UP 2007, 19)
Or
What is an Array? What are its different types? Explain. (UP 2009, 12)
Or
Explain the subscripted variable. (UP 2017)
Answer:
Subscript: A subscript may be a numeric constant or an integer-valued variable, is enclosed in parenthesis which identifies the position of a given element in the array. For example, the first element of (UPBoardSolutions.com) array stu_age (containing the value 14) is referred to as stu_age [0].
Similarly,
stu_age [1] = 16
stu_age [2] = 18
stu_age [3] = 17
stu_age [4] = 15
Here, 0, 1, 2, 3, 4 within parenthesis are known as subscript. In ‘C’ first element is in the Oth place and last element in the (n -l)th place in the array of n elements.

UP Board Solutions

Subscripted Variable: A variable with a subscript is known as subscripted variable and it refers to one value in the array, e.g., stu_age [0], stu_age [1], etc.
Declaration of an Array: As you know that all variables in ‘C’ must be declared before use, hence, we must declare the array. It is done at the beginning of the function main () with data type and size.
Syntax:
datatype name [size];
Example:
int stu_age [5];

This statement states that stu_age is an array of 5 integers (Number of elements). This statement reserves enough memory for stu_age to hole 5 integers. Once the declaration is made, stu_age [0] refers to the first integer in (UPBoardSolutions.com) the array, stu_age [1] refers to the second integer in the array and so on.

UP Board Solutions
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables

Question 2.
(a) Explain the following with reference to ‘C’ language: (U. P. 2006)
(i) Data Type
(ii) Variables.
(b) What are the various arithmetic operators available in ‘C’ language? Explain with example.
Answer:
(a) (i) Data Type: A data type decides the amount of memory to be allocated to a variable to store a particular type of data. To allocate memory for a particular piece of data, we have to declare a variable of a particular data type. The variable declaration means that some memory is allocated and that portion of memory will be referred to by the variable name.
Data types, which are commonly used in programming tools can be classified as :

  • Numeric: Stores numeric value.
  • Alpha Numeric: Stores descriptive information.

A numeric data type is called int: Similarly, an alpha-numeric data type is named char in C.

(ii) Variables: A variable is a name that represents a number or a string. Each numeric variable must consist of a letter or a letter followed by an integer. All variables that are to be used in the program must be declared prior to its use. Declaring a variable means defining a name and a data type of a variable. Every variable declaration is terminated by a semicolon. Variable (UPBoardSolutions.com) names must begin with an alphabet. The first character may be followed by a sequence of letters or digits and can also include the special character ‘Underscore’.

UP Board Solutions

(b) Arithmetical Operators: Operators that perform mathematical operations are called Arithmetical operators. These operators form a mathematical expression using operands along- with. There are five types of arithmetical operands available in C++ which are as follows:
(i) Add (+): To perform addition of operands. These operands can either be literal, identifier or combination of both.
e.g.:
a + b
2 + 2
x + 2

(ii) Subtract (-): In order to perform subtraction, operands can be literal, identifier or combination of both.
e.g.:
x – y
15 – 5
A – 10

(iii) Multiply (*): This operator performs multiplication on operands.
e.g.:
y * z
15 * 32
A * 25

UP Board Solutions

(iv) Divide (/): It is used to perform division of the two operands.
e.g.
A/B
25/5
X/2

(v) Exponentiation (%): It is a modulus operator and returns the remainder of the division. A / operator returns the quotient after the division of operands and a modulus operator returns the remainder after division.
e.g.
10 % 3
X % 2

Question 3.
What do you mean by sorting? Define two methods of sorting. (UP 2004, 05, 11)
Or
Give names of the main methods of sorting and explain any one method with an example. (UP 2014, 15)
Answer:
Sorting: Sorting is the process of arranging the data or information in (UPBoardSolutions.com) some logical order. This logical order may be ascending or descending in case of numeric values or dictionary order in case of alphanumeric values.
For example: Suppose an unsorted array X of ten numeric values.
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables
There are some methods of sorting the data of an array.

  1. Insertion sorting
  2. Bubble sorting
  3. Selection sorting.

UP Board Solutions

Insertion Sorting: This process uses only one array and requires (N – 1) passes and total comparison required are N (N – l)/2 to sort this array. The processing of sorting in ascending order is as follows:
Suppose an unsorted array A is
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables Q3.1
This array has 6 elements, so it will complete the sorting in 5 passes (N – 1 ⇒ 6 – 1 = 5)
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables
In this pass, the first element of an array should be compared with the rest of the array elements and placed the smallest element on top in ascending order.

UP Board Solutions
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables
Suppose an unsorted array A is
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables Q3.4
Now you will sort this array using bubble sort method. In this method also, (UPBoardSolutions.com) sorting requires (N – 1) passes to sort the elements of the array.
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables

Question 4.
What is searching? Explain its mechanism. (UP 2007, 11, 15)
Or
What is searching? Explain two searching techniques. (UP 2009, 15)
Answer:
Searching: It refers to the process of finding the location of the given data element from a collection of data. The search is said to be successful if the given data element is found.
There are two searching techniques :

  1. Linear Search
  2. Binary Search.

UP Board Solutions

1. Linear Search: It is also known as sequential search. In sequential searching, a particular data item is searched sequentially, Le., the desired data first compared with the first element then the second element of an array, (UPBoardSolutions.com) and so on.
Example: WAP in ‘C’ to find the given number in the given array of 10 numeric type values:
Program :

# include<stdio.h>
void main()
{
int A [10] = {10, 50, 6, 7, 20, 30, 15, 25, 80, 90},
int i, N;
printf (“Input the Number”);
scanf(“%d”, &N);
for (i = 0; i < 10; i ++)
{
if (N = = A[i])
printf (“%d is present in list on %d position”, N, i);
break;
}
printf (“N is not present”);
}

2. Binary Search: In binary searching, the arranged data is divided into two parts. The particular data item to be searched is compared with the middle data item. If it is less than the middle data, then it means that the data item to be searched is present in the first half of the data item set. The loop will be created for only half of the total value, thus, it saves the computer time also. In a binary search, it is mandatory that the data be arranged in either ascending or descending order.
Example: Given a sorted (ascending order) array A with elements and we want to search the element 15 in it by binary search.
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables Q4
Binary Search Method:
Given Array A
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables Q4.1
To start with, we take BEG = 0, END = 6, and compute location of the middle element as MID = (BEG + END)/2 = (0 + 6)/2 = 3.

UP Board Solutions

Since, A[MID] le., A[3] ≠ 15, and BEG < END. We start next iteration. As A[MID] = 20 > 15, therefore, we take END = MID -1=3-1=2, where BEG remains unchanged.
MID = (BEG + END)/2 = (0 + 2)/2 = 1
Since, A[MID] le., A[1] ≠ 15, and BEG < END.
We start the next iteration.
As A[MID] = 10 < 15, therefore, we take BEG = MID + 1 = 1 + 1 = 2, where END remains unchanged; since BEG = END, again compute location of the middle element as
MID = (BEG + END)/2 = (2 + 2)/2 = 2
Since A[MID] le., A[2] = 15, the search terminates with success.

Question 5.
What do you mean by Array? Define different types of array. (UP 2008, 12, 15, 19)
Or
What do you understand by Array? What are its different types? Describe each of them. (UP 2011)
Or
What do you understand by Array? Discuss one dimensional and two-dimensional array with example. (UP 2017)
Answer:
An array is the collection of numeric or string values in the form of LIST (single row) or TABLE (rectangular arrangements in the form of rows and columns). A single variable name is used to refer to the entire collection of (UPBoardSolutions.com) items. ‘C’ language permits us to deal with many related data items as a group by means of the structure known as an array.

An array can be used to store integer, real or string values, but the values in a given array must be of the same type. That is, if an array is given a numeric variable name, a string data item cannot be entered to it, only numeric values are allowed. For example, suppose that there are five test scores 15, 25, 35, 81, 75 to be stored. The scores could be put in an array called TEST. This array can be represented in memory as such.

UP Board Solutions
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables
There are two types of array.
1. Single-dimensional array: It is a collection of numeric or string values in the form of a list. This is also known as single subscript variables because these variables have one subscript only e.g. int a[10].

2. Multi-dimensional array: It is defined in the same manner as a single-dimensional array, except that a separate pair of square brackets are required for each subscript. It is the collection of numeric or string values in the form of TABLE
e.g. A[5][6], B[2][3][2] etc.

UP Board Solutions

Question 6.
WAP to sort the elements of an array in ascending order. (UP 2006)
Answer:

#include<stdio.h>
void main()
{
int A[100];
int n, i, j, temp;
printf (“Enter how many nos”);
scant (“%d”, &n);
for (i = 0; i < n; i++)
{
scanf (“%d”, &A[i]);
}
for (i =0; i < n - 1; i++)
{
for (j = 0; j < n + i; j++)
{
if (A [j +1] < A[j])
temp = A[j];
A[j] =A[j + 1];
A[j + 1] = temp;
}}
for (i = 0; i < n; i++)
{
printf (“%d”, A[i]);
}
}

Question 7.
WAP to search the given number in the given array of 10 numeric type values:
Answer:

#include<stdio.h>
void main ()
{
int A[10] = {10, 50, 20, 30, 6, 7, 8, 70, 90, 75};
int i, n;
printf (“input the number”);
scanf (“%d”, &n);
for (i = 0; i < 10; i++)
{
if (n == A[i])
printf (“%d is present in list on %d position”, n, i);
break;
}
printf (“%d is not present”, n)
}

UP Board Solutions

Subscripted Variables Short Answer Type Questions (4 Marks)

Question 1.
What do you mean by subscript? (UP 2012)
Answer:
To gain access to a single element within the array, a subscript is used. A subscript may be a numeric constant or an integer-valued variable, is enclosed in parentheses which identify the position of a given element in the array. (UPBoardSolutions.com) For example, the first element of array TEST (containing the value 15) is referred to as TEST(0J. The second test score is as TEST[1], the third test score is as TEST[2], and so on. Therefore, the following statements are true:
TEST[0] = 15
TEST[1] = 25
TEST[2] = 5
TEST[3] = 81
TEST[4] = 75
Here, 0, 1, 2, 3 and 4 within parentheses are known as a subscript.

Question 2.
Define the term List and Table.
Answer:
An array is a collection of numeric or string values in the form of LIST or TABLE.
LIST: List is a kind of arrangement in which values are arranged either in horizontal form or vertical form in a sequential row.
e.g.,
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables SAQ 2
TABLE: Table is a rectangular arrangement of values in the form of rows and columns.
e.g.,
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables

UP Board Solutions

Question 3.
WAP to find the factorial of ‘n’.
Answer:

#include<stdio.h>
void main()
{
int n, i, fact = 1;
printf (“Enter the value for n”);
scanf (“%d”, &n);
for (i = 1; i <= n; i++)
{
fact = fact * i;
}
printf (“factorial of %d is %d”, n, fact);
}

Question 4.
What is Binary Search? (UP 2011, 19)
Answer:
In this method of searching, only sorted data can be used. Unsorted data cannot be used to apply this type of search. To do searching in Binary method, the sorted data is divided into two parts and the particular element is compared (UPBoardSolutions.com) with the middle element. If found greater, the first and middle element is divided into two parts and their middle element is compared. And if found smaller, the middle and the last element is divided into two parts and their middle element is compared. This process goes on until the search is completed. This method of search is quick and saves time. It is also known as Random search.

UP Board Solutions

Question 5.
Write a short note on sorting? (UP 2008, 11, 12)
Answer:
It is easy to carry out different operations on the idea if it is arranged or in some order (ascending or descending). The process of arranging the data or information in some order (ascending or descending in case of numeric data and dictionary order in case of alphanumeric data) is called sorting.
Example:
UP Board Solutions for Class 10 Computer Science Chapter 8 Subscripted Variables

Question 6.
Write a short note on searching? (UP 2008)
Or
Differentiate between sequential and binary search. (UP 2014)
Answer:
Searching: Searching means finding an element from an array. It refers to the process of finding the location of a given data element from an array. For example: If you want to work on your computer notebook, you have to search for it for yourself. You can do searching by two methods:

1. Sequential Search: This search is also known as linear search because in this method to search an element from data source one has to compare particular data item with the first element than the second element and so on until the search is completed. Because of this sequential approach, it is known as sequential search. In this, if the element is found in the middle, search process terminates.

2. Binary Search: In this method of searching, only sorted data can be used, unsorted data cannot be used to apply this type of search. To do searching in Binary method, the sorted data is divided into two parts and the particular element is (UPBoardSolutions.com) compared with the middle element. If found greater, the first and that middle element is divided into two parts and their middle element is compared. And if found smaller, the middle and the last element is divided into two parts and their middle element is compared. This process goes on until the search is completed. This method of search is quick and saves time. It is also known as Random search.

UP Board Solutions

Subscripted Variables Very Short Answer Type Questions (2 Marks)

Question 1.
From which element binary search starts searching in an array?
Answer:
From the middle element, the binary search starts searching in an array.

Question 2.
What do you mean by sorting? (UP 2012)
Answer:
Sorting is the process of arranging the data in some order.

Question 3.
Is an array a collection of similar elements?
Answer:
Yes, an array is a collection of similar elements.

Question 4.
What is the number of the first element in an array?
Answer:
The first element in the array is (UPBoardSolutions.com) numbered 0.

UP Board Solutions

Question 5.
What are the different methods of sorting?
Answer:
The different methods of sorting are:

  1. Insertion
  2. Bubble
  3. Selection.

Question 6.
Arranging the data in some order is known as:
Answer:
Sorting.

Question 7.
Name two types of searching.
Answer:
Sequential and Binary.

UP Board Solutions

Subscripted Variables Objective Type Questions (1 Marks)

There are four alternative answers for each part of the questions. Select the correct one and write in your answer book:

Question 1.
A double dimensional array is a collection of a numeric value in the form of:
(a) TABLE
(b) WAP
(c) SORT
(d) None of these.
Answer:
(a) TABLE

Question 2.
Which of the following is not a character constant?
(a) Sorry
(b) Enter values of A, B, C.
(c) 123.50
(d) All of the above.
Answer:
(d) All of the above.

UP Board Solutions

Question 3.
If x is an integer variable, x = will return a value:
(a) 2.5
(b) 3
(c) 2
(d) 1
Answer:
(b) 3

Question 4.
The maximum width of a ‘C’ variable name can be:
(a) 5 characters
(b) 8 characters
(c) 10 characters
(d) 20 characters.
Answer:
(b) 8 characters

UP Board Solutions for Class 10 Computer Science

UP Board Solutions for Class 10 Computer Science Chapter 7 Introduction to ‘C’

UP Board Solutions for Class 10 Computer Science Chapter 7 Introduction to ‘C’

Introduction to ‘C’ Long Answer Type Questions (8 Marks)

Question 1.
Explain the structure of a ‘C’ program with example. (UP 2019)
Answer:
Structure of ‘C’ Program:
Before understanding the structure of a ‘C’ program you must know these important points:

  • ‘C’ is a case sensitive language, it means all the keywords must be written in lower case.
  • Key-words can’t be used as a variable or function name.
  • Every instruction should end with (;) sign.
  • Preprocessor directives (required) should (UPBoardSolutions.com) be there in the beginning.
  • Function main () is must for a program.

UP Board Solutions

Now to write a program in ‘C’ we need to follow these steps:
Define preprocessor directives (include header files according to prototype functions, standard I/O library functions to be used).

  • Open function main ()
  • Assign data types and variables.
  • Define the body of the function
  • End the function main ()

Example

/* harsh.c : first example for students */
# include
void main ()
{
int a = 10, b = 15, c;
printf (“Hellow students \n”);
c = a + b ;
printf (“The sum of % d and % d is % d”, a, b, c);
}

UP Board Solutions

In the above example the first line
/*harsh.c: first example for students */
is a comment and non-executable. Comments in ‘C’ begins with (/*) and ends with (*/).

Second-line
#include
is a preprocessor directive. The preprocessor processes the ‘C’ program before the compiler. Here stdio.h is a header file consists of standard I/O functions. A header file related to the functions used (UPBoardSolutions.com) in program should be included at the beginning.
The line
void main()
indicates “the beginning of the program”. The compilation of the program starts from main () function.
{, the symbol indicates the beginning of the main () function

The line
int a = 10, b = 15, C;
is for declaration of variables and data types.

Lines
printf (“Hellow students \n”);
C = a + b.
printf (“The sum of % d and % d is % d”, a, b, c);
are the body of the program.
and symbol ‘}’ indicates end of main ( ) function.

UP Board Solutions

Question 2.
What is looping? Write about the different statements used to erect loop in ‘C’?
Answer:
Looping
Looping Statements: A computer program is a set of statements, which is normally executed sequentially. But in most of the cases, it is necessary to repeat certain steps to meet a specific condition. This repetitive operation is done through a loop control structure.
A loop is basically the execution of the sequence of statements repeatedly until a particular condition is true or false. In ‘C’ language following looping statements are used:

while Statements:
The while loop repeats a statement or a set of statements until a certain condition is true.
Syntax

while (condition)
{
statements
}

Here, the condition may be any expression having a non-zero value. The loop continues until the condition is true. When the condition fails, the program body attached with loop (statements), will not be executed.

Example: To print the first 20 natural numbers.

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main ()
{
int a = 1;
while (a < = 20)
{
printf (“%d”, a);
a++;
}
getch ();
}

do-while statement:
Working of this statement is similar to the working of while statement but (UPBoardSolutions.com) in this, at least one time the attached loop (statements) is executed, no matter whether the condition is true or false.
Synax:

do
{
statements
}
while (condition);

Example: To print first 10 odd numbers.

UP Board Solutions

#include<stdio.h> 
#include<conio.h>
void main ()
{
int a = 1;
do
{
printf (“% d”, a);
a+ = 2;
{while (a <=19)};
}

for loop statement:
The for loop is an ideal looping statement when we know how many times the loop will be executed.
Syntax:

for (initialization; condition; counter)
{
statements
}

Here,

  • Initialization is generally an assignment which is used to set the loop control variable, e.g., a = 0.
  • Condition always tells the limit of the loop or determines when to exit the loop. e.g., a < 10
  • Counter defines how the loop control variable will change each time the loop is (UPBoardSolutions.com) repeated. This may be incremented or decremented. e.g., a++, a-

UP Board Solutions-.

Example: To print your name 10 times.

#include<stdio.h>
#include<conio.h>
void main ()
{
int i;
char name [20];
clrscr ();
printf (“Enter your name”);
gets(name);
for (i = 1; i <= 10; i++)
puts (name);
}
getch ();
}

Introduction to ‘C’ Short Answer Type Questions (4 Marks)

Question 1.
Explain the character set in ‘C’.
Answer:
Character Set in ‘C’. The set of characters that may appear in a legal ‘C’ program is called the character set for ‘C’. These include some graphics as well as non-graphic characters. The ‘C’ character set consists of upper case and lower case alphabets, (UPBoardSolutions.com) special characters, digits and white spaces. The alphabets and digits together are called the alphanumeric characters.
Alphabets
A, B, C, ………, Y, Z.
a, b, c, ………, y, z.
‘C’ is case sensitive language, it means lower and upper case are different.

UP Board Solutions

Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Special Characters

  • , → Comma
  • % → Percent sign
  • . → Period
  • ? → Question mark
  • ; → Semicolon
  • & → Ampersand
  • : → Colon
  • ^ → Caret
  • # → Number sign (Hash)
  • * → Asterisk
  • ‘ → Apostrophe
  • – → Minus sign
  • ” → Quotation mark
  • + → Plus sign
  • ! → Exclamation mark
  • / → Slash
  • | → Vertical bar
  • \ → Backslash
  • ~ → Tilde
  • < → Opening angle bracket
  • > → Closing angle bracket
  • _ → Underscore
  • $ → Dollar sign
  • ( → Left parenthesis
  • ) → Right parenthesis
  • [ → Left bracket
  • ] → Right bracket
  • { → left brace
  • } → Right brace

UP Board Solutions

Question 2.
What is a variable?
Answer:
Variable: A variable is an entity that has a value and is known to the program by a name. A variable definition associates a memory location with the variable name. A variable can have only one value assigned to it at any given time (UPBoardSolutions.com) during the execution of the program. Its value may change during the execution of the program.
Example:
a = 20, 5;
b = 10;
here, a and b are variables.

Variable names are identifiers used to name variables. They are symbolic names given to memory locations. A variable name consists of a sequence of letters and digits, the first character being a letter. The rules that apply to identifiers also apply to variable names.
Examples of valid variable names are:
a → Class
abcl → employee
Stu-data → 12 MAX

Examples of invalid variable names are:
a’s → illegal character (’)
Stu data → blank space not allowed
2Max → first character should be a letter
Classmarks → comma not allowed

UP Board Solutions

Question 3.
WAP to input 10 numbers and print its sum.
Answer:

#include<stdio.h>
#include<conio.h>
void main ()
int N, SUM = 0, i;
clrscr () ;
for (i=1; i <=10; i++)
{
printf (“Enter a number”);
scanf (“% d”, & N);
SUM = SUM + N;
printf (“\n The sum often numbers is % d”, SUM);
getch ();
}

Question 4.
WAP to find the sum of following series:
Answer:
Sum = [latex]\frac { 1 }{ 1 } +\frac { 1 }{ 2 } +\frac { 1 }{ 3 } +……….+\frac { 1 }{ n } [/latex]

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main ()
{
int n, i;
float sum;
printf (“Enter the number of terms\n”);
scanf (“%. d”, & n);
i = 1;.
do
{
sum = sum + 1 /i;
i = i + 1;
}
while (i <= n);
printf (“% f\ sum);
getch ();
}

Question 5.
WAP to calculate factorial or any given number.
Answer:

#include<stdio.h>
#include<conio.h>
void main( )
{
int n, i;
long int fact = 1;
clrscr ();
printf(“\n Enter any number”);
scanf(“%d”, & n);
for (i=1; i < = n; i + +)
{
fact = fact *i;
}
printf (“The factorial of % d is % 1d”, n, fact);
getch ();
}

UP Board Solutions

Question 6.
WAP to generate the following series:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Answer:

#include<stdio.h>
#include<conio.h>
void main ( )
{
int i, j;
clrscr ();
for (i=1; i <= 5; i + +)
{
for (j=1; j <= i; j++)
{
printf (“% d\t”, i);
}
printf (“\n”);
}
getch ();

Introduction to ‘C’ Very Short Answer Type Questions (2 Marks)

UP Board Solutions

Question 1.
From where the compilation of the program starts?
Answer:
from main () function.

Question 2.
% operator returns what?
Answer:
Remainder.

Question 3.
Who developed ‘C’ language?
Answer:
Dennis Ritchie and Ken Thompson.

Question 4.
A loop within a loop is known as ……….
Answer:
Nested loop.

Question 5.
Which data type consists of fractional values?
Answer:
float.

UP Board Solutions

Introduction to ‘C’ Objective Type Questions (1 Marks)

There are four alternative answers for each part of the questions. Select the correct one and write it in your answer-book.

Question 1.
A variable name must start with:
(a) A number
(b) An alphabet
(c) $ symbol
(d) # sign.
Answer:
(b) An alphabet

Question 2.
% s is used for:
(a) Character data type
(b) Numeric data type
(c) String data type
(d) Float data type.
Answer:
(c) String data type

Question 3.
‘!=’ is a/an:
(a) Arithmetical operator
(b) Relational operator
(c) Logical operator
(d) Assigning operator.
Answer:
(b) Relational operator

UP Board Solutions

Question 4.
Which header file is used for scanf () and printf ()?
(a) conio.h
(b) stdio.h
(c) math.h
(d) Both (a) and (b).
Answer:
(d) Both (a) and (b).

Question 5.
Which of them is not a looping statement?
(a) for
(b) while
(c) if
(d) do-while.
Answer:
(c) if

UP Board Solutions for Class 10 Computer Science