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?
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.
6. When do we call a function user-defined? Is printf() a user-defined function? Justify.
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;
}
14. Write a C program and define a recursive function to find the summation of first N natural numbers.