XI

WELCOME CLASS XI!!!

FEEDBACK PLEASE



Updates, Question papers and practice examples shall be posted here.
1. Structures
   Click here for sample programs 


2.CLICK HERE FOR CLASS X1 PPT

4.Lab exam questions

1)WAP to search for a given substring from a line of text

2)WAP to search for a given word in a given string

3)WAP to swap adjacent elements in an array
eg. INPUT:- 1 2 3 4 5 6
  OUTPUT:- 2 3 4 5 6 1

4)WAP to print the following pattern

                     *
                  *    *
                *   *    *
                   *   *
                     *
5)WAP to reverse the contents of an integer array.
eg. 12  34  45  67 should change to 67 45 35 12


CLICK HERE FOR SOLUTIONS

 small quiz for those interested:-


Code for Q6:-

for(i =0; i<5;i++);
if(i% 2 == 0)
cout<<i<<" ";
else cout<<i;

Code for Q7:-
cout<<a++ + ++a;

Code for Q8:-
QUESTION CODE for Q8 (assume header files are included)
int num = 3;
switch(num)
{
case 1:
case 2:
case 3: cout<<"Was 1 to 3\n";
case 4: cout<<"Was 4\n";
default: cout<<"Unknown";
}



Assignment: Implement the programs given above with th help of user defined functions.


SOLVE THE PROGRAMS GIVEN BELOW by writing an userdefined function:

1. WAP to check if a given number is prime or not using function.
2. WAP to find factorial of a number using function.
3.WAP to perform linear search using function.
4. WAP to find x^n using fuction.
5.WAP to find largest number in an array using fuction.
6. WAP to find sum of two matrices using function.
7. WAP to print primary and secondary diagnal elements using function.
8. WAP to reverse a character array by using function.
9.WAP using function to merge two sorted arrays into a single sorted array(use a third array)
10.Write a program to find sum of elements in a 2 D array using functions


HOTS
If you feel confident on function try this problem. 

1. Write a program to perform insertion/deletion and display a 1 dimensional array based on the users choice.(Use separate user defined functions for each operation User defined function has to be used)
CLICK HERE FOR SOLUTION

EXPECTED OUTPUT
Add caption


2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. I got some valuable suggestions from few. I shall try to incorporate them......

    ReplyDelete