Get the most accurate UP Board Solutions for Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर here. Updated for the 2026 27 academic session, these solutions are based on the latest UP Board textbooks for Class 10 Computer Science. Our expert-created answers for Class 10 Computer Science are available for free download in PDF format.
Detailed Chapter 10 स्ट्रिंग डेटा हेरफेर UP Board Solutions for Class 10 Computer Science
For Class 10 students, solving UP Board textbook questions is the most effective way to build a strong conceptual foundation. Our Class 10 Computer Science solutions follow a detailed, step-by-step approach to ensure you understand the logic behind every answer. Practicing these Chapter 10 स्ट्रिंग डेटा हेरफेर solutions will improve your exam performance.
Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर UP Board Solutions PDF
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.
Answer: String Functions. String functions are those functions which 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:
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:
void main()
{
char str[ ] = "rajeev";
prinft ("lower case = %S”, str);
strupr (str);
printf ("upper case = %S", str);
}
Output: Lower case = rajeev Upper case = RAJEEV
In simple words: String functions in C handle string data. STRCPY copies one string to another, STRLWR converts to lowercase, and STRUPR converts to uppercase, all demonstrated with simple code examples.
🎯 Exam Tip: Remember to include the `
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 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.
In simple words: `gets()` reads a multiword string input from the user, unlike `scanf()`, and `puts()` displays a string and moves the cursor to the next line, making it suitable for printing entire lines of text.
🎯 Exam Tip: While `gets()` is useful for multiword input, it's generally considered unsafe due to buffer overflow risks. For exams, understand its functionality, but in real-world coding, prefer safer alternatives like `fgets()`. `puts()` is efficient for displaying strings followed by a newline.
Question 3. What is concatenation? Explain with example. Or Explain the mechanism of Concatenation of a new word in a string.
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 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.
In simple words: Concatenation is the process of joining two strings together to create a single, longer string. In C, the `strcat()` function is used for this purpose, appending the source string to the end of the target string.
🎯 Exam Tip: When using `strcat()`, ensure the destination string (target) has enough allocated memory to accommodate both its original content and the appended source string, plus the null terminator. Failure to do so can lead to buffer overflows and program crashes.
Question 4. WAP to check for palindrome.
Answer: Program:
#include
#include
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");
}
}
In simple words: This program checks if an entered word is a palindrome by copying the original word, reversing the original, and then comparing the reversed word with the stored original.
🎯 Exam Tip: To score well, clearly demonstrate the logic: inputting the string, creating a copy, reversing the original string, and then using `strcmp()` to compare the reversed string with the original copy. Ensure correct header inclusions and error-free syntax.
Question 5. WAP to change a string from lower case to upper case.
Answer: Program:
#include
#include
#include void main()
{
char str [20];
puts ("enter a string in lower case");
gets (str);
strupr (str);
printf ("upper case = %S”, str);
}
In simple words: This program takes a string input from the user, converts it entirely to uppercase using the `strupr()` function, and then prints the modified string.
🎯 Exam Tip: Remember that `strupr()` (and `strlwr()`) are non-standard C functions, often found in `conio.h` on some compilers (like Turbo C++). For portability, C99 and later prefer character-by-character conversion using `toupper()` from `ctype.h` in a loop, but for exams using `conio.h` contexts, `strupr()` is acceptable.
String Data Manipulation Short Answer Type Questions (4 Marks)
Question 1. What is strlen in 'C' language?
Answer: STRLEN(): This function calculates the length of a string. It returns 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);
}
In simple words: `strlen()` is a C function that determines the length of a string by counting the number of characters until it encounters the null terminator (`\0`), excluding the terminator itself.
🎯 Exam Tip: Emphasize that `strlen()` *does not* count the null character (`\0`) when calculating the length. This is a common point of confusion for students and a key detail for evaluation.
Question 2. What are the strings?
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
In simple words: In C, a string is essentially an array of characters, where the end of the string is marked by a special null character (`\0`).
🎯 Exam Tip: Highlighting the null terminator (`\0`) as the defining characteristic of a C string is crucial for a complete answer. Also, mention that string literals are enclosed in double quotes.
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 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(strl, “Rajeev");
j = strcmp (str l, str 2);
k = strcmp (strl, “Rajeev Sharma");
printf ("\n % d %d % d", i, j, k);
}
Output: 0-1 – 32
In simple words: The `strcmp()` function compares two strings character by character based on their ASCII values to determine if they are identical or how they differ lexicographically. It returns 0 if they are identical, a negative value if the first string is "less than" the second, and a positive value if the first is "greater than".
🎯 Exam Tip: Clearly state the three possible return values of `strcmp()` (0, positive, negative) and what each signifies. Providing a simple example with known string comparisons helps illustrate understanding.
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.
In simple words: The `strlen()` function is used to determine the length of a string.
🎯 Exam Tip: Just knowing the function name is enough for a very short answer, but remember it calculates the number of characters before the null terminator.
Question 2. What is the name of the function which is used to copy a string into another?
Answer: strcpy () function.
In simple words: The `strcpy()` function is used to copy the content of one string into another.
🎯 Exam Tip: For `strcpy()`, remember to ensure the destination string has enough memory to hold the source string to avoid buffer overflows.
Question 3. In 'C' language a string is terminated with what?
Answer: In 'C' language a string is terminated by null character or '10'.
In simple words: A string in C is always terminated by a null character, represented as `\0`.
🎯 Exam Tip: The null character `\0` is fundamental to C strings; always remember its role in marking the end of a string. Note that '10' as printed in OCR is an error and should be interpreted as `\0` for null character (ASCII 0) or potentially '0' (ASCII 48).
Question 4. What is the ASCII value of ‘10' and '0'?
Answer: ASCII value of '10' is 0. ASCII value of '0' is 48.
In simple words: The ASCII value for the null character (`\0`, often incorrectly represented as '10' in OCR due to misinterpretation) is 0, while the ASCII value for the character '0' is 48.
🎯 Exam Tip: Distinguish carefully between the null terminator `\0` (ASCII 0) and the character digit '0' (ASCII 48). This is a common trick question to test fundamental understanding of character representations.
Question 5. The process of appending one string at the end of smother string is known as ..........
Answer: Concatenation.
In simple words: The act of combining two strings by placing one after the other is called concatenation.
🎯 Exam Tip: Concatenation is typically performed using the `strcat()` function in C, which appends a source string to a destination string.
Question 6. Function to check the time of the day.
Answer: time ().
In simple words: The `time()` function is used to obtain the current calendar time.
🎯 Exam Tip: The `time()` function usually returns the current time as the number of seconds since the Epoch (January 1, 1970). It requires the `
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
In simple words: In most programming languages, including C, a variable name must begin with an alphabet character or an underscore.
🎯 Exam Tip: Remember the basic rules for variable naming: start with a letter or underscore, and subsequent characters can be letters, numbers, or underscores. Keywords are reserved.
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
In simple words: In format specifiers for functions like `printf()` or `scanf()`, `%s` is used to handle string data types.
🎯 Exam Tip: Understand common format specifiers: `%s` for strings, `%d` or `%i` for integers, `%f` for floats, `%c` for characters, and `%lf` for doubles.
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
In simple words: The `conio.h` header file (Console Input/Output) provides functions for console-specific operations, which may include functions like `sesmf()` (likely a typo for a console-related function) and specialized `print()` variants on certain compilers.
🎯 Exam Tip: Be aware that `conio.h` is not a standard C library header and is specific to compilers like Turbo C/C++. Standard C input/output functions are found in `stdio.h`.
Question 4. Which of the following is not a looping statement?
(a) for
(b) if
(c) while
(d) do-while.
Answer: (b) if
In simple words: The `if` statement is a conditional control structure that executes code only if a condition is true, whereas `for`, `while`, and `do-while` are looping statements that repeatedly execute code.
🎯 Exam Tip: Clearly differentiate between conditional statements (`if`, `else if`, `else`, `switch`) and looping statements (`for`, `while`, `do-while`) as they control program flow differently.
UP Board Solutions for Class 10 Computer Science
Free study material for Computer Science
UP Board Solutions Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर
Students can now access the UP Board Solutions for Chapter 10 स्ट्रिंग डेटा हेरफेर prepared by teachers on our website. These solutions cover all questions in exercise in your Class 10 Computer Science textbook. Each answer is updated based on the current academic session as per the latest UP Board syllabus.
Detailed Explanations for Chapter 10 स्ट्रिंग डेटा हेरफेर
Our expert teachers have provided step-by-step explanations for all the difficult questions in the Class 10 Computer Science chapter. Along with the final answers, we have also explained the concept behind it to help you build stronger understanding of each topic. This will be really helpful for Class 10 students who want to understand both theoretical and practical questions. By studying these UP Board Questions and Answers your basic concepts will improve a lot.
Benefits of using Computer Science Class 10 Solved Papers
Using our Computer Science solutions regularly students will be able to improve their logical thinking and problem-solving speed. These Class 10 solutions are a guide for self-study and homework assistance. Along with the chapter-wise solutions, you should also refer to our Revision Notes and Sample Papers for Chapter 10 स्ट्रिंग डेटा हेरफेर to get a complete preparation experience.
FAQs
The complete and updated UP Board Solutions Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर is available for free on StudiesToday.com. These solutions for Class 10 Computer Science are as per latest UP Board curriculum.
Yes, our experts have revised the UP Board Solutions Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर as per 2026 exam pattern. All textbook exercises have been solved and have added explanation about how the Computer Science concepts are applied in case-study and assertion-reasoning questions.
Toppers recommend using UP Board language because UP Board marking schemes are strictly based on textbook definitions. Our UP Board Solutions Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर will help students to get full marks in the theory paper.
Yes, we provide bilingual support for Class 10 Computer Science. You can access UP Board Solutions Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर in both English and Hindi medium.
Yes, you can download the entire UP Board Solutions Class 10 Computer Science Chapter 10 स्ट्रिंग डेटा हेरफेर in printable PDF format for offline study on any device.