2017 universities Ranking in Pakistan

Here are overall top universities of Pakistan.Some universities are at the top place in engineering fields but others are at Applied science, BA and in IT programs

Binary Search in C++

Search found at index

Quick sorting program

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Tree traversal (preorder,inorder,postorder) using linklist (c++)

Tree traversal (preorder,inorder,postorder) using linklist (c++)

Wednesday, 10 October 2018

Operation with dynamically 2-D arrays


Write a menu driven program to do following operation on two dimensional arrays dynamically created at run time depending upon user’s requirement. Take the size of arrays from user. The size of first array is nxl, the size of second array is lxm. The arrays need not to be only square in size. 
 

1. Add the contents of the two array A and B and store it in third array C.  
2. Multiply array A and B and store the results in another array D 
3. Upper-half which takes a two dimensional array A, with size N rows and N columns as argument and prints the upper half of the array including diagonal. Here is an example,
   12 13 11 15 10                           12 13 11 15 10
   27 21 25 23 21                                21 25 23 21
   32 35 37 38 31                                     37 38 31
   40 41 45 40 41                                          40 41
   53 54 59 51 55                                               55
4. Lower-half which takes a two dimensional array A, with size N rows and N columns as argument and prints the lower half of the array excluding diagonal in the array.


Program:


#include <iostream>

using namespace std;

void sum(int **A,int **B,int row,int col);
void multi(int **A,int **B,int row,int col);
void Upper_half(int **A,int row,int col);
void lower_half(int **A,int row,int col);

void sum(int **A,int **B,int row,int col)
{
    int **C;

     C=new int*[row];
    for(int i=0;i<5;i++)
     C[i]=new int[col];
     // summing
      for(int r=0;r<row;r++)
            {
                for(int c=0;c<col;c++)
                {
                    C[r][c]=(A[r][c])+(B[r][c]);
                }
            }

            // Printing array 'C' elements
    cout<<" \n Sum of two array 'A' & 'B' in to array 'C' :"<<endl<<endl;
            for(int r=0;r<row;r++)
            {
                for(int c=0;c<col;c++)
                {
                cout<<C[r][c]<<"    ";
                }
            cout<<endl;
            }
}

void multi(int **A,int **B,int row,int col)
{
    int **D;

     D=new int*[row];
    for(int i=0;i<5;i++)
     D[i]=new int[col];

     // Multiplying Two arrays
            for(int r=0;r<row;r++)
            {
                for(int c=0;c<col;c++)
                {
                    D[r][c]=(A[r][c])*(B[r][c]);
                }
            }

            // Printing array 'D' elements

            cout<<" \n Multiplaying Array 'A' & 'B' and saving into array 'D':"<<endl<<endl;
            for(int r=0;r<row;r++)
            {
                for(int c=0;c<col;c++)
                {
                cout<<D[r][c]<<"    ";
                }
            cout<<endl;
            }

}

void Upper_half(int **A,int row,int col)
{
         cout<<" \n Upper-half including triangle of 2d array is:"<<endl<<endl;
          int i, j;

    for (i = 0; i < row; i++)
    {
        for (j = 0; j < col; j++)
        {
            if (i > j)
            {
                cout << "    ";
            }
            else
            cout <<A[i][j] << "   ";
        }
        cout << endl;
    }
}
void lower_half(int **A,int row,int col)
{
    cout<<" \n Upper-half including triangle of 2d array is:"<<endl<<endl;
          int i, j;

           for (i = 0; i < row; i++)
            {
                for (j = 0; j < col; j++)
                    {
                        if (i<j)
                        {
                            cout << "    ";
                        }
                        else
                            cout <<A[i][j] << "   ";
                    }
            cout << endl;
            }
}

int main()
{
    int **A;
    int **B;

    int row,col;
    cout<<"Enter the number of rows:"<<endl;
    cin>>row;
    cout<<"Enter the number of columns:"<<endl;
    cin>>col;

    A=new int*[row];
    for(int i=0;i<5;i++)
        A[i]=new int[col];

        B=new int*[row];
    for(int i=0;i<5;i++)
        B[i]=new int[col];

cout<<"Enter value for rows and colums of array 'A' :"<<endl;
         for(int r=0;r<row;r++)
            {
                for(int c=0;c<col;c++)
                {
                    cin>>A[r][c];
                }
            }

cout<<"Enter value for rows and colums of array 'B' :"<<endl;
         for(int r=0;r<row;r++)
            {
                for(int c=0;c<col;c++)
                {
                    cin>>B[r][c];
                }
            }

sum(A,B,row,col);
multi(A,B,row,col);
Upper_half(A,row,col);
lower_half(A,row,col);

    return 0;
}

Monday, 11 June 2018

Sorting String in Alphabetic Order ( whole stiring sentence)


The following program sort the whole string without OOP. No object is used in this program.
Dynamic memory allocation is used.  This program can sort whole string sentence in alphabetic order.

#include<iostream>
#include<string>
using namespace std;
int main()
{
 string *p;
 int n,i;
 cout<<"Enter the size of dynamic memory allocation:"<<endl;
 cin>>n;
 int temp;
  p=new string[n];
     cout<<"Enter words:"<<endl;
     for(int i=0;i<n;i++)
    {
    cin>>p[i];
    }
   
    cout<<"You entered:"<<endl;

        for(int i=0;i<n;i++)
        {
            cout<<p[i]<<endl;   
        }

    int index[100];   

        for(int i=0;i<=n;i++)
          {
              index[i]=i;
          }

        for(int i=0;i<n;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                if(p[index[i]]>p[index[j]])
                {
                temp = index[i];
                index[i] = index[j];
                index[j] = temp;
                }
            }
        }

    cout<<"The alphbetic order is:"<<endl;
    for(int i=0;i<n;i++)
    {
    cout<<p[index[i]]<<endl;
    }   
   
return 0;
}

Thursday, 28 September 2017

Computer fundamental | Pradeep K. Sinha and Priti Sinha | Notes for BS(cs)



This is the notes of computer fundamentals which is written by "Pradeep K. Sinha and Priti Sinha".
Notes for the following chapters:
chap1| introduction
chap2: BCO
Chap3: Number system
Chap4: Computer codes
Chap5: computer arithmetic
Chap6: Boolean algebra
Chap7: PAM
chap8: secondary storage
chap9: i-o device
chap10: cs
chap11: PCP
chap 12: CL
chap13: SIO
chap14: OS
chap 15: ASP
chap 16: BDP
chap 17: DCCN
chap 18: internet
chap 19: Multimedia
chap 20: COC
chap 21: intro. to C programming

  To download all the chapters notes  of "computer fundamental" just click the download button below:
studyforadmission
New Website Design? Contact Us at Quatro Link

Wednesday, 27 September 2017

TIPS to get better grades | Entry Test


Today entry test or any test is difficult to pass because day by day education is becoming advance.Most of the Students in any category are not getting enough grades to pass the test.The reason for them to get fail is that, that they always think they have passed the FSC and they have enough knowledge to pass the entry test.There is some mistake which is done by most of the students while attempting the entry test paper.which is listed below.

  • Joining Entry test preparation academy while studying FSC.
  • They have no such information about entry test date.
  • They believe that they can easily pass the test.
  • Shortage of time

TIPS

  • They should revise some of the courses of FSC such as maths, physics and chemistry/computer science.
  • They should first attempt easy section in the paper.

  • If there is no section like ETEA.They should attempt easy questions and leave the difficult one.

  • They shouldn't be sleepy while attempting paper.
  • They should solve the past papers.
  • They should know how to manage the time for most students, it's a big problem.
  • They should work harder and harder.

Tuesday, 19 September 2017

Chapter 2 solution | Engg. mechanics statistic 12 edition of RC-Hibbeler




Russ Hibbeler moved on from the University of Illinois-Urbana with a B.S. in Civil Engineering (major in structures) and a M.S. in Nuclear Engineering. He acquired his Ph.D. in Theoretical and Applied Mechanics from Northwestern University. Hibbeler's expert experience incorporates postdoctoral work in reactor wellbeing and examination at Argonne National Laboratory, and basic work at Chicago Bridge and Iron, Sargent and Lundy, Tucson. He has worked on building in Ohio, New York, and Louisiana. He has educated at the University of Illinois-Urbana, Youngstown State University, Illinois Institute of Technology, and Union College. Hibbeler as of now instructs at the University of Louisiana-Lafayette.
To download solution of chapter 2( Engg. mechanics statistic 12 edition of RC-Hibbeler) click the download now link below:
                                                               
Download now
New Website Design? Contact Us at Quatro Link