Class 10 Chapter 7 Solution SEBA Computer Science Solution

Looking for Class 10 Chapter 7 notes and solutions? You’ve come to the right place! Our website offers well-structured, easy-to-understand study materials that align perfectly with the latest CBSE syllabus. These notes are crafted by subject matter experts to provide clear explanations and step-by-step solutions to help you master even the most challenging topics. Whether you’re preparing for exams or need a quick revision, our resources ensure you’re always ready. Access our Class 10 Chapter 7 solutions now and take your learning to the next level!

Exercise

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

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

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

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

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

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

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

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

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

10. Consider the below code and list all the syntax errors.
`#include<stdio.h>
int fun ( int x )
{
if ( x %2 == 0 )
return 1;
else
return 0;
}
int main()
{
int number;
printf (“\n Enter the number: ” );
scanf ( “%d”, &number );
int x = fun ( );
return 0;
}

11. Consider the code segment below and find out the output if the user enters 5 from
the keyboard when asked for.
`#include<stdio.h>
int fun ( int x )
{
if ( x %2 == 0 )
return 1;
else
return 0;
}
int main()
{
int number;
printf (“\n Enter the number: ” );
scanf ( “%d”, &number );
int x = fun ( number);
printf(“%d”, x);
return 0;
}

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

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

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

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

Scroll to Top