Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int j, i;
- printf("Enter number ::");
- int n;scanf("%d",&n);
- int arr1[10];
- printf("Enter 1st array ::");
- for(i=0; i<n;i++)
- {
- scanf("%d",&arr1[i]);
- }
- int arr2[10];
- printf("Enter 2nd array ::");
- for(i=0; i<n;i++)
- {
- scanf("%d",&arr2[i]);
- }
- printf("After swaping 1st Array :");
- for(i=0 ; i<n;i++)
- {
- arr1[i]=arr1[i]+arr2[i];
- arr2[i]=arr1[i]-arr2[i];
- arr1[i]=arr1[i]-arr2[i];
- printf("%d ",arr1[i]);
- }
- printf("\n");
- printf("After swaping 2nd Array ::");
- for(i=0 ; i<n;i++)
- {
- printf("%d ",arr2[i]);
- } return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement