Results 1 to 6 of 6

URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

This is a discussion on URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY within the C++ forums, part of the Courses category; 4- Using the double dimension arrays declare the int arrays of dimension [4][5] and take the values input at run ...

  1. #1
    iTT Student
    Join Date
    May 2011
    Location
    pakistan
    Posts
    54

    Smile URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

    4- Using the double dimension arrays declare the int arrays of dimension [4][5] and take the values input at run time and find out the minimum and sort them in descending order value from those inputted values....
    REPLY FAST
    As rule man is fool;
    When its hot he wants it cool;
    when its cool ;
    he wants it hot ;
    always wanting what is not ;

  2. #2
    Senior Student Adnan Ahmad Khan's Avatar
    Join Date
    Aug 2010
    Location
    Bannu/Pakisatn
    Age
    27
    Posts
    261

    Re: URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

    // This code is for compiler Turbo v4.5
    #include<iostream.h>
    void descend (int*,int*);
    main()
    {
    int num[4][5];
    cout<<"Enter Twenty Numbers :";
    for (int i=0;i<4;i++)
    {
    for (int j=0;j<5; j++)
    { //two for loops for input values
    cin>>num[i][j];
    }
    }
    int smaller=num[0][0];
    for (int row=0; row<4; row++)
    {
    for (int col=0; col<5; col++)
    {
    if (smaller>num[row][col])
    { // for finding smaller number
    smaller=num[row][col];
    }
    }
    }
    cout<<"Smaller Number Is : "<<smaller<<endl ;

    for (int pass=0; pass<20; pass++)
    {
    for (int k=0;k<4;k++) //for desecending order
    {
    for (int l=0; l<5; l++)
    {
    descend (&num[k][l],&num[k][l+1]);
    }
    }
    }
    cout<<"Descending Order Is :";
    for (int m=0; m<4; m++)
    {
    for (int n=0; n<5; n++) //to display values ....
    {
    cout<<" "<<num[m][n];
    }
    }
    cout<<endl;
    return 0;
    } // main ended
    void descend (int *num1, int *num2)
    {
    if (*num1<*num2)
    {
    int temp;
    temp=*num1;
    *num1=*num2;
    *num2=temp;
    }
    }
    If you want to be alive forever, Then DIE for others...

  3. #3
    iTT Student
    Join Date
    May 2011
    Location
    pakistan
    Posts
    54

    Re: URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

    thank youu very much .. yar.. kuch game ka programing ka baray ma batha do yar ... us ka logics kasay hothay ha ... thanx alot
    As rule man is fool;
    When its hot he wants it cool;
    when its cool ;
    he wants it hot ;
    always wanting what is not ;

  4. #4
    Senior Student Adnan Ahmad Khan's Avatar
    Join Date
    Aug 2010
    Location
    Bannu/Pakisatn
    Age
    27
    Posts
    261

    Re: URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

    sorry yr.... kbi gaming ka code nhi deka..... maloom hogya tho zaroor bta 2nga..... aur aapko maloom ho jaye tho mjay bta dena.....
    If you want to be alive forever, Then DIE for others...

  5. #5
    iTT Student
    Join Date
    May 2011
    Location
    pakistan
    Posts
    54

    Re: URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

    ok yhanx yar tm apna email batana
    As rule man is fool;
    When its hot he wants it cool;
    when its cool ;
    he wants it hot ;
    always wanting what is not ;

  6. #6
    Senior Student
    Join Date
    Oct 2012
    Location
    Rawalpindi
    Age
    28
    Posts
    98

    Re: URGENT HELP NEEDED IN DOUBLE DIMENTION ARRAY

    kia masla hy rat ky 12 han. kis ki dimension ko kia takleef hy ?

Similar Threads

  1. Urgent Help Needed
    By krazzyfaiq in forum C++
    Replies: 3
    Last Post: 21st January 2012, 01:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •