Class 10 Chapter 8 Solution SEBA Computer Science Solution

Looking for Class 10 Chapter 8 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 8 solutions now and take your learning to the next level!

Exercise

1. How is a pointer variable different from a normal variable?

2. Why is dynamic memory allocation an efficient memory management technique?

3. How many bytes are needed to store an int pointer variable? Is it the same for a char pointer variable? Write a simple C program to explain your answer.

4. Write the output of the following code segment.
a.
int *ptr, x = 9;
ptr = &x;
printf(“\n %d”, (*ptr)++);

b.
int *ptr, x = 9;
ptr = &x;
printf(“\n %d”, (*ptr)++);
printf(“\n %d”, *ptr);

c.
int *ptr, x = 9;
ptr = &x;
int y = ++(*ptr);
printf(“\n %d”, y);

d.
char *ptr, x = ‘A’;
ptr = &x;
char y = *ptr;
printf(“\n %c”, y);

e.
char *ptr, x = ‘A’;
ptr = &x;
char y = (*ptr)++;
printf(“\n %c”, y);

f.
char *ptr, x = ‘A’;
ptr = &x;
char y = ++(*ptr);
printf(“\n %c”, y);

g.
char *ptr, x = ‘A’;
ptr = &x;
char *y;
y = ptr;
printf( “\n %c”, ++(*y) );

5. Write a C program to dynamically allocate memory for an array to store 10 integers and display the first 5 out of them.

6. Write a C program to dynamically allocate memory for an array to store runs scored by Virat Kohli in the last ten ODI cricket matches. Write a function to find the maximum one.

7. Write a C program and define a function that takes the length of your name as an input parameter and then allocates memory dynamically to store your name. Write another function to display the name.

8. Write a C program to store some integer variables in an array. Then write functions to the following.
a. To calculate the number of even numbers in the array.
b. To dynamically allocate memory to a new array to store only the even numbers.
c. To copy the even numbers from the first array to the second one.

9. Write a C program to store some integer variables in an array. Then write functions to
the following.

a. To calculate the number of even numbers in the array.
b. To dynamically allocate memory to a new array to store only the even numbers.
c. To copy the even numbers from the first array to the second one

Scroll to Top