Friday, November 2, 2012

How to create a program to copy the contents of the array A to array B are empty by the number

Name : Om Chanlyta
Major : TMD

#include<stdio.h>
#include<stdlib.h>
#include<string>

int main(){
    int label =5, k = 0;
    int A[5];
    int B[5];
    for(k=0; k<label;k++){
        printf("Please input value %d :\n",k+1);
        scanf("%d", &A[k]);

    }
    printf("Array : int A[5]; \n");
    printf("Index : 1 2 3 4 5 \n");
    printf("Value :");
    for(k = 0; k<label; k++){
        printf("%d",A[k]);
        B[k] = A[k];
    }

    printf("\n\n Array : int B[5]; \n");
    printf("Index : 1 2 3 4 5 \n");
    printf("Value :");
    for (k = 0; k < label; k++){
        printf("%d", B[k]);
    }
    printf("\n");
    system("pause");
}

Below is my video :

This is my link:
http://www.youtube.com/watch?v=1U5YZMMIOyA&feature=youtu.be

No comments:

Post a Comment