School Assignments for Class 12 Computer Science: Library Functions
Explore structured practice materials through the CBSE Class 12 Computer Science Library Functions Assignment. Tailored for Class 12 learners, utilizing these Computer Science assignments ensures thorough preparation and strengthens foundational knowledge before final CBSE evaluations.
Practice Class 12 Computer Science Assignments: Library Functions
View or download the dedicated CBSE Class 12 Computer Science Library Functions Assignment resource below. Engaging with these assignments under focused study conditions ensures continuous academic progress and mastery of the 2026-27 curriculum.
Fill in the blanks
Question. _________ is a self-contained block of statements that perform a specific task.
Answer: Function
Question. Functions can be broadly classified broadly in ____________ categories.
Answer: two
Question. __________ function converts the character type in argument to lower case
Answer: tolower()
Question. Library functions that carry out standard input/output operations are included in __________ header file
Answer: stdio.h
Question. All library functions available are grouped under __________ file.
Answer: header
Short answer type Questions
Question. Functions can be classified into how many types?
Answer: Functions can be classified mainly into two categories:
Library or Built-in functions: Those functions, which are in-built or predefined in the C language, are called standard or library functions. All these functions are organized in header files (also called library files). To use any library function, we must include the corresponding header file (in which it is defined) in our program. For example: clrscr( ), printf(), scanf(), sqrt(), strcpy() etc. are the predefined functions.
User defined functions: Those functions, which are defined by the user, are called user defined functions. User can define his own functions to fulfil his requirements. The function main() is an example of user defined function. Its body is defined by user.
Question. Explain library function?
Answer: Those functions, which are in-built or pre-defined in the C language, are called standard or library functions. All these functions are organized in header files (also called library files). To use any library function, we must include the corresponding header file (in which it is defined) in our program. For example: clrscr( ), printf(), scanf(), sqrt(), strcpy() etc. are the predefined functions. The input output functions scanf( ) and printf( ) are defined in the stdio.h header file. So, we have to include this file in our program if we want to use these functions. Similarly, string functions strlen( ), strcpy( ), strcat( ), strcmp( ), strupr( ), strlwr( ) etc. are defined in the string.h header file. So, we must include string.h header file to use these string functions in our program.
Question. Which files are included at the beginning of program and why?
Answer: Header files are included at the beginning of program. Extension of these files is .h. Library functions are logical grouped into header files. To use any library function, we have to include corresponding header files in which they are defined. That is why these header files are included at the beginning of the program. Some of the commonly used header files are: stdio.h, conio.h, math.h, string.h etc.
Question. Explain difference between user-defined and library function?
Answer: The difference between user-defined and library functions are given below:
Library or Built-in functions: Those functions, which are in-built or pre-defined in the C language, are called standard or library functions. All these functions are organized in header files (also called library files). To use any library function, we must include the corresponding header file (in which it is defined) in our program. For example: clrscr(), printf(), scanf(), sqrt(), strcpy() etc. are the predefined functions.
User defined functions: Those functions, which are defined by the user, are called user defined functions. User can define his own functions to fulfil his requirements. The function main() is an example of user defined function. Its body is defined by user.
Question. Give the names of library functions included in string.h file?
Answer: all the string handling functions has been defined in the string.h header file. Some of the commonly used string functions are given below:
• strlen() function
• strcmp() function
• strcat() function
• strcpy() function
• strrev) function
• strupr() function
• strlwr() function
Question. Give the names of any four header files used in C?
Answer: Commonly used header files used in C along with their library functions are given below:
i. Header file – stdio.h: Full form of stdio is Standard Input Output. This header file contains the functions that are used for Standard Input and Output operations. For example: printf(), scanf() functions
ii. Header file – ctype.h: This header file contains functions that are used to perform operations on character data.
For example: tolower(), toupper(), islower(), isupper() etc.
iii. Header file – string.h: This header file contains functions that are used to perform operations on string data. For example: strlen(), strupr(), strlwr(), strcat(), strcmp() etc.
iv. Header file – math.h: This header file contains functions that are used to perform mathematical operations. For example: sqrt(), pow(), sin(), cos() etc.
Question. Explain strcpy function with example?
Answer: Function strcpy stands for string copy. This function is used to copy a string value into string variable. Following code shows how to use this function. This function is present in the string.h header file. Therefore, to use this function, we have to include the string.h header file in our program.
strcpy(str, “Punjab”);
It copy/store the string value “Punjab” into the string variable str.
Question. Write a program in C using tolower function?
Answer: The functions tolower() is used to convert the character value into the lower case. Consider the following
example program:
#include<stdio,h>
#include<stdio,h>
#include<stdio,h>
void main()
{
char value;
value=tolower(‘A’);
printf(“%c”,value); //shows a
}
Question. Write a program in C using strcat function?
Answer: The function strcat is used to concatenate (combine) two string values. Consider the following example
program:
#include<stdio,h>
#include<stdio,h>
void main()
{
char value1[20]=”Hello”;
char value2[20]=”Students”
strcat(value1,value2);
printf(“%s”,value1); //shows Hello Students
}
Long answer Type Questions
Question. What are the main advantages of functions?
Answer: (see Chapter 3rd)
Question. Describe library functions? Explain any four in detail.
Answer: Those functions, which are in-built or pre-defined in the C language, are called standard or library functions. All these functions are organized in header files (also called library files). To use any library function, we must include the corresponding header file (in which it is defined) in our program. For example: clrscr( ), printf(), scanf(), sqrt(), strcpy() etc. are the predefined functions. Four library functions are explained below:
Function strcpy():Function strcpy stands for string copy. This function is used to copy a string value into string variable. This function is present in the string.h header file. Therefore, to use this function, we have to include the string.h header file in our program. Following code shows how to use this function. strcpy(str, “Punjab”); //copy Punjab into str
Function strlen():Function strlen() stands for string length. This function is used to count the total number of characters in the given string. This function is present in the string.h header file. Following code shows how to use this function: strlen(“punjab”); //returns 6
Function sqrt (): Sqrt stands for square rootFunction. It is a mathematical function. It returns the square root of the gven value. This function is present in the math.h header file. Following code shows how to use this function: sqrt(36); //returns 6.0 Function toupper(): This function is used to convert the given character value to upper case. Thisfunction is present in the ctype.h header file. Following code shows how to use this function: toupper(‘a’); //returns A
Question. Write a program to calculate square root of a number using library function.
Answer: The function sqrt() is used to calculate the square root of number. This function is present in the math.h header
file. Following program shows how to use this function:
#include<stdio,h>
#include<stdio,h>
void main() {
float result;
result=sqrt(9);
printf(“%f”,result); //shows 3.000000
}
Question. Write a Program which accept a Character and convert it into upper case.
Answer: The function toupper() is used to convert a character into upper case. This function is present in the ctype.h
headerfile. Following program shows how to use this function:
#include<stdio,h>
#include<stdio,h>
void main()
{
char value;
value=toupper(‘a’);
printf(“%c”,value); //shows A
Question. Write a program to calculate the length of following string: “satik”
Answer: The function strlen() is used to calculate the length of a string. This function is present in the string.h header file.
Following program shows how to use this function:
#include<stdio,h>
#include<stdio,h>
void main() {
int length;
length=strlen(“Satik”);
printf(“%d”,length); //shows 5
}
Question. Write a program to find the sum of following series: H = x2 + x4 + x6 + ………………+xn
Answer:
Free study material for Computer Science
Chapter Assignment & Practice Material for Class 12 Computer Science Library Functions
Download Assignment: Library Functions (Class 12 Computer Science)
Review targeted chapter assignments for Class 12 Computer Science Library Functions. Built according to official CBSE guidelines, these downloadable problem sets help students build accuracy and prepare effectively for school tests.
Key Advantages of Solving Library Functions Assignments
- Syllabus Compliance: Sets reflect current CBSE evaluation criteria and official marking frameworks.
- Multi-Format Practice: Includes varied problem types designed to deepen comprehension across all sub-topics.
- Time Management: Routine practice optimizes pacing to finish school examinations comfortably within schedule.
How to Approach Computer Science Library Functions Assignments
- Textbook Review: Always study the core NCERT book for Class 12 Computer Science prior to beginning the assignment.
- Independent Attempt: Solve Library Functions questions on your own initially before cross-checking with expert solutions.
- Error Tracking: Record challenging concepts in a dedicated notebook and practice online MCQ tests for revision.
FAQs
You can download free PDF assignments for Class 12 Computer Science Library Functions from StudiesToday.com. These practice sheets have been updated for the 2026-27 session covering all concepts from latest NCERT textbook.
Yes, our teachers have given solutions for all questions in the Class 12 Computer Science Library Functions assignments. This will help you to understand step-by-step methodology to get full marks in school tests and exams.
Yes. These assignments are designed as per the latest CBSE syllabus for 2026. We have included huge variety of question formats such as MCQs, Case-study based questions and important diagram-based problems found in Library Functions.
Practicing topicw wise assignments will help Class 12 students understand every sub-topic of Library Functions. Daily practice will improve speed, accuracy and answering competency-based questions.
Yes, all printable assignments for Class 12 Computer Science Library Functions are available for free download in mobile-friendly PDF format.