Looking for reliable SEBA Class 10 Computer Science Chapter 7 (Functions in C) extra questions and answers for the 2026–27 academic year? Access important user-defined function programs, function declaration vs definition notes, call by value vs call by reference explanations, recursion questions, and exam-oriented practice problems to score top marks in your HSLC board exams.

Q1. What is a function in C?

Answer: A function is a named block of code that performs a specific task and can be reused multiple times within a program.



Q2. Why are functions used in C programming?

Answer: Functions are used to break down a large and complex program into smaller, manageable, and reusable parts.



Q3. What are the two main types of functions in C?

Answer: The two main types of functions in C are built in (library) functions and user defined functions.



Q4. Give two examples of built in functions in C.

Answer: Two common examples of built in functions are printf() and scanf() .



Q5. What is a user defined function?

Answer: A user defined function is a custom function created by the programmer to perform a specific task based on requirement.



Q6. What is the syntax of a function definition in C?

Answer: The standard syntax of a function definition is:

return_type function_name(parameter_list)
{
return value;
}

Q7. What is the syntax of a function call?

Answer: The syntax to call a function is:

function_name(arguments);

Q8. What is a function declaration (or prototype)?    

Answer:     A function declaration tells the compiler about the function's name, return type, and parameters before the main body of the program executes.


Q9. What is the purpose of a return statement in a function?    

Answer:     The return statement sends a value back from the function to the statement that called it and ends the execution of that function.


Q10. Can a function return more than one value at a time?    

Answer:  No, a standard function in C can return only one value at a time using the   return   statement.


Q11. What are the key advantages of using functions in C?    

Answer:  The key advantages of using functions include:

   Code Reusability:     Writes the code once and allows it to be used multiple times.
   Easier Debugging:     Makes identifying and fixing errors quicker because the code is structured in smaller modules.
   Modularity:     Organizes complex programs into neat, logical sections.
   Reduced Complexity:     Reduces repetition and simplifies the overall program design.
   Better Readability:     Makes the overall program easier to read and understand.



Q12. Differentiate between built  in functions and user  defined functions.    

Answer:  
FeatureBuilt in FunctionsUser defined Functions
DefinitionPre defined in standard C header libraries.Created by the programmer according to project needs.
Examplesprintf(), scanf(), sqrt()sum(), calculateArea(), display()
UsageUsed directly by importing header files.Must be declared, defined, and written by the coder.
Q13. What are the three essential components of a function in C?    

Answer:   The three essential components are:

Function Declaration (Prototype): Informs the compiler about the function before it is called.

Function Definition: Contains the actual block of code that carries out the task.

Function Call: Executes the function from main() or another block of code.

Q14. What is a function prototype and why is it used?

Answer: A function prototype specifies the function’s name, parameter list, and return type at the top of a C program. It allows the compiler to check whether the function is being called with the correct data types and arguments before running it.

Q15. Explain the difference between actual parameters and formal parameters.

Answer: Actual Parameters: The real values or variables passed inside a function call from the calling program (e.g., sum(a, b) ).
Formal Parameters: The local variables defined in the function header that receive those incoming values (e.g., void sum(int x, int y) ).

SEBA Class 10 Computer Science Chapter 7 Extra Questions

Q16. What is recursion in C?

Answer: Recursion is a programming technique where a function calls itself directly or indirectly to solve a problem by breaking it into smaller steps.

Q17. Give an example of a problem that uses recursion.

Answer: A classic example of recursion is calculating the factorial of a number (n! = n x (n – 1)!).

Q18. Can a function call another function in C?

Answer: Yes, a function can easily call another function inside its body. It can even call itself, which is known as recursion.

Q19. What is the default return type of a function in C if none is specified?

Answer: If no return type is explicitly specified for a function, the C compiler assumes the return type to be int (integer) by default.

Q20. Is it possible to create a function that does not return any value?

Answer: Yes, we can create a function with no return value by specifying its return type as void .

Q21. Explain the four categories of user defined functions based on arguments and return values.

Answer: User defined functions are classified into four structural types:

No arguments and no return value: The function takes no inputs and returns no data back to the caller.

With arguments but no return value: The function receives values from the caller but does not return any output back.

No arguments but with a return value: The function receives no inputs but calculates and returns a result to the caller.

With arguments and with a return value: The function receives input values, processes them, and returns the result back to the caller.

Class 10 Computer Science Chapter 7 Important Questions SEBA 2026-27

Q22. Explain the concept of “Call by Value” in C.

Answer: In the Call by Value method, copies of the actual parameter values are passed into the function’s formal parameters. Because the function works with temporary copies, any changes made to the parameters inside the function do not affect the original variables in the calling program.

Q23. Can a function be defined after the main() function? Explain.

Answer: Yes, a function can be defined after main() . However, if you place the definition below main() , you must write its function prototype (declaration) above main() so the compiler recognizes the function when it is called.

Q24. Differentiate between local variables and global variables.

Answer: Local Variables: Declared inside a specific function or code block. They can only be accessed within that function and are erased when the function finishes running.
Global Variables: Declared outside of all functions, usually at the top of the program file. They can be accessed and modified by any function throughout the program.

Q25. Describe the main parts that form a function definition.

Answer: A function definition consists of four key parts:

Return Type: Specifies what type of data (e.g., int , float , void ) the function returns.

Function Name: The unique identifier used to call the function.

Parameter List: The variables enclosed in parentheses that accept input values passed to the function.

Function Body: The enclosed set of instructions within curly braces {} that executes the specific logic, ending with a return statement if applicable.

Q26. Can a function be called multiple times in a program?

Answer: Yes, a function can be called as many times as necessary from different parts of a program. This helps avoid re writing the same code multiple times.

Q27. Write the general layout of a C program that uses a user defined function.

Ans:

#include<stdio.h>

return_type function_name(data_types);

int main()
{

function_name(arguments);
return 0;

}

return_type function_name(parameters)
{
return value;
}

Functions in C Class 10 SEBA Extra Question Answer

Q28. What happens if a non  void function does not include a return statement?    

 Answer:   If a function declared with a return type (such as   int   or   float  ) omits a return statement, it will output unpredictable garbage values to the caller, potentially causing logical errors or compiler warnings.

Q29. What are header files and why are they important in C?    

Answer:  Header files (such as   <stdio.h>   or   <math.h>  ) are pre  written library files containing declarations of standard functions. They are essential because they supply the definitions and protocols needed for standard operations like input/output (  printf()  ,   scanf()  ) and mathematical operations (  pow()  ,   sqrt()  ).

Q30. Why is modularity an important concept in computer programming?    

Answer:  Modularity breaks a large software application down into distinct, self  contained function units. This makes code substantially easier to write, debug, maintain, and expand over time, while allowing team members to work on separate modules independently.

Here are the 10 C programs formatted as exam ready questions with their corresponding code and exact outputs.

C Program Questions & Answers

Q31. Write a C program to create a function that adds two numbers.    

Ans:    

  

#include<stdio.h>

int add(int a, int b)
{
return a + b;
}

int main()
{
int x = 5, y = 7;
printf(“Sum = %d”, add(x, y));
return 0;
}

Output:    

  text

Sum = 12

Q32. Write a C program to demonstrate a function with no arguments and no return value.    

Ans:    

#include<stdio.h>

void greet()
{
printf(“Hello, World!”);
}

int main()
{
greet();
return 0;
}

Output:    

  text

Hello, World!

Q33. Write a C program using a user  defined function to calculate the factorial of a number.    

Ans:    

  

#include<stdio.h>

int fact(int n)
{
int i, f = 1;
for(i = 1; i <= n; i++)
f = i;
return f;
}

int main()
{
int n = 5;
printf(“Factorial = %d”, fact(n));
return 0;
}

Output:    

  text

Factorial = 120

Q34. Write a C program to find the maximum of two numbers using a function.    

Ans:    

  

#include<stdio.h>

int max(int a, int b)
{
if(a > b)
return a;
else
return b;
}

int main()
{
int x = 10, y = 20;
printf(“Max = %d”, max(x, y));
return 0;
}

Output:    

  text

Max = 20

Q35. Write a C program to create a function that checks whether a given number is even or odd.    

Ans:    

  

#include<stdio.h>

void check(int n)
{
if(n % 2 == 0)
printf(“Even”);
else
printf(“Odd”);
}

int main()
{
check(7);
return 0;
}

Output:    

  text

Odd

Q36. Write a C program to demonstrate a function that takes an argument but has no return value to print the square of a number.    

Ans:    

  c

#include<stdio.h>

void square(int n)
{
printf(“Square = %d”, n n);
}

int main()
{
square(6);
return 0;
}

Output:    

  text

Square = 36

Q37. Write a C program to print the Fibonacci series up to $n$ terms using a function.    

Ans:    

 

#include<stdio.h>

void fibonacci(int n)
{
int a = 0, b = 1, c, i;
printf(“%d %d “, a, b);
for(i = 2; i < n; i++)
{
c = a + b;
printf(“%d “, c);
a = b;
b = c;
}
}

int main()
{
fibonacci(10);
return 0;
}

Output:    

  text

0 1 1 2 3 5 8 13 21 34

Q38. Write a C program to find the factorial of a number using recursion.    

Ans:    

  

#include<stdio.h>

int fact(int n)
{
if(n == 0)
return 1;
else
return n fact(n 1);
}

int main()
{
printf(“Factorial = %d”, fact(5));
return 0;
}

Output:    

  text

Factorial = 120

Q39. Write a C program to calculate the area of a circle using a function.    

Ans:    

  

#include<stdio.h>

float area(float r)
{
return 3.14 r r;
}

int main() {
float r = 5;
printf(“Area = %.2f”, area(r));
return 0;
}

Output:    

  text

Area = 78.50

Q40. Write a C program to demonstrate swapping two numbers using the Call by Value method.    

Ans:    

  c

#include<stdio.h>

void swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
printf(“Inside function: a=%d, b=%d\n”, a, b);
}

int main()
{
int x = 10, y = 20;
swap(x, y);
printf(“Outside function: x=%d, y=%d”, x, y);
return 0;
}

Output:    

  text

Inside function: a=20, b=10
Outside function: x=10, y=20

HSLC Computer Science Functions in C Important Questions

SEBA Class 10 Computer Science Chapter 7 Practice Programs

💻 Updated Extra Questions Guide Notice: This page features an extensive collection of SEBA Class 10 Computer Science Chapter 7 (Functions in C) Extra Questions and Detailed Answers updated for the 2026–27 academic session. All user-defined function logic, parameter-passing code snippets, and conceptual revision notes strictly follow the latest revised Assam Board (SEBA) curriculum.

💡 Ace Your HSLC Computer Science Exam:

Leave a Reply

Your email address will not be published. Required fields are marked *