Computer Science With C++ Chapter 6 Data File Handling
  • Sponsor Area

    NCERT Solution For Class 12 Computer And Communication Technology Computer Science With C++

    Data File Handling Here is the CBSE Computer And Communication Technology Chapter 6 for Class 12 students. Summary and detailed explanation of the lesson, including the definitions of difficult words. All of the exercises and questions and answers from the lesson's back end have been completed. NCERT Solutions for Class 12 Computer And Communication Technology Data File Handling Chapter 6 NCERT Solutions for Class 12 Computer And Communication Technology Data File Handling Chapter 6 The following is a summary in Hindi and English for the academic year 2021-2022. You can save these solutions to your computer or use the Class 12 Computer And Communication Technology.

    Question 1
    CBSEENCO12011720

    Write a function SWAP2BEST (int ARR[], int Size) in C++ to modify the content of the array in such a way that the elements, which are multiples of 10 swap with the value present in the very next position in the array.

    For example:

    If the content of array ARR is 90,56,45,20,34,54

    The content of array ARR should become 56,90,45,34,20,54

    Solution
    #include <iostream.h>
    #include <conio.h>
    void SWAP2BEST(int ARR[], int Size); 
    int main ()
    {
    //Here we are taking different values for more perfect result with more
    //numbers of array elements. You can change the values and number of array
    //elements as per your choice.
    	int ListofNum[8] = {6, 28, 30, 17, 50, 45, 80, 82};
    	clrscr();
    	SWAP2BEST(ListofNum, 8 ) ; 
    	return 0;
    }
    void SWAP2BEST(int ARR[], int Size)
    {
    	int i= 0; int temp=0;
    #include <iostream.h> 
    #include <conio.h>
    	void SWAP2BEST(int ARR[], int Size); 
    	int main ()
    	{
    //Here we are taking different values for more perfect result with more
    //numbers of array elements. You can change the values and number of array
    //elements as per your choice.
    		int ListofNum[8] = {6, 28, 30, 17, 50, 45, 80, 82};
    		clrscr(); SWAP2BEST(ListofNum, 8 ) ;
    		return 0;
    	}
    	void SWAP2BEST(int ARR[], int Size)
    	{
    		int i= 0; int temp=0;
    for (i = 0; i < Size; ++i)//loop for printing original array values
    {
    	cout<<ARR[i]<<;
    }
    cout<<endl;
    for (i = 0; i < Size; ++i)
    {
    	if(ARR[i+1]=='\0')
    	{
    	}
    	else
    	{
    		if(ARR[i+1]%10==0)
    		{
    			temp=ARR[i];
    			ARR[i]=ARR[i+1];
    			ARR[i+1]=temp;
    		}
    	}
    }
    for (i = 0; i < Size; ++i)	//loop for printing swapped array value
    {
    	cout<<ARR[i]<<;
    }
    }
    Question 2
    CBSEENCO12011721

    An array T[20][10] is stored in the memory along the column with each of the element occupying 2 bytes, find out the memory location of T[10][5], if an element T[2][9] is stored at location 7600.

    Solution

    AssumingLBR=LBC=0
    B=7600
    W=2 bytes
    Number of Rows(N)=20
    Number of Columns(M)=10
    LOC(Arr[I] [J]) = B +(I + J*N)*W
    LOC(T[10][5]) = 7600+(10+5*20)*2
    = 7600 + (300*2)
    = 7600 + 600
    = 8200

    Mock Test Series

    Sponsor Area

    Sponsor Area

    NCERT Book Store

    NCERT Sample Papers

    Entrance Exams Preparation

    25