BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 3rd Semester > Object Oriented Programming

Object Oriented Programming By Mam Sidra Malik


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 13-10-2008, 10:11 PM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 35
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Copy elements of Two arrays to another ONE in C++

Code:
#include <iostream>
using namespace std;

void main()
{
    int n=10;
    char myarray1[5]={'1','2','3','4','5'};
    char myarray2[5]={'6','7','8','9','0'};
    char myarray3[10];

    for(int i=0;i<=n;i++)
    {
        if(i<=5)
        {
            myarray3[i]=myarray1[i];
        }
        else
        {
            myarray3[i]=myarray2[i-5];
        }
    }

    cout<<myarray3[9]; // shows that myarray3 has Got values from other arrays on it's 9 index 

}

Reply With Quote
  #2  
Old 13-10-2008, 11:48 PM
Danish Hussain's Avatar
Teenager

 
Join Date: Oct 2007
Location: Multan
Posts: 89
Contact Number: 061-111-11-9393
Program / Discipline: ------
Class Roll Number: 07-09
Danish Hussain will become famous soon enough
Send a message via Yahoo to Danish Hussain Send a message via Skype™ to Danish Hussain
Default Re: Copy elements of Two arrays to another ONE

shukriya shukriya..........
__________________
DanishHussain.NET
Reply With Quote
  #3  
Old 14-10-2008, 12:44 AM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 35
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Copy elements of Two arrays to another ONE in C++

Iss main Coloring ki hay .., Is liay Thanx kaha hay?
Waisay Yeh Sahi Execute ho jata hay
Reply With Quote
  #4  
Old 14-10-2008, 01:22 AM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Default Re: Copy elements of Two arrays to another ONE in C++

Whats about the 0 indexed element of second array i.e. 6 not showing... Ah..
By the way function is write...
Mam was satisfied... LOL
Code:
#include <iostream>
using namespace std;

void main()
{
    int n=10;
    char myarray1[5]={'1','2','3','4','5'};
    char myarray2[5]={'6','7','8','9','0'};
    char myarray3[10];

    for(int i=0;i<=n;i++)
    {
        if(i<=5)
        {
            myarray3[i]=myarray1[i];
        }
        else
        {
            myarray3[i]=myarray2[i-5];
        }
    }

for (int j=0;j<=9;j++)
    cout<<myarray3[j]; 
}

Attached Images
 
__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
  #5  
Old 14-10-2008, 01:30 AM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 35
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Copy elements of Two arrays to another ONE in C++

Mam nay konsa execute kar kay check karna hay
Reply With Quote
Reply

Tags
arrays, copy, elements


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program using Arrays Final Programs of V.B (M .Sheraz anjum) .BZU. Visual Programming 0 15-12-2009 11:12 PM
Find the Average of all elements in an Array VB Code (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:01 PM
Program to find the Sum of all elements in an Array (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:00 PM
Taking transpose of a matrix program code: implementation of 2 dimensional arrays taha khan Visual Programming 0 10-12-2009 11:15 PM
Chapter # 7 Arrays BSIT07-01 Visual Programming 0 09-12-2009 08:00 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 01:36 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.