Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- =====================================================
- chapter 6: Functions
- Ex8:
- =====================================================
- */
- public class MyProgram {
- public static int[] add(int arr1[],int arr2[]){
- int size= arr1.length>arr2.length? (arr1.length)+1: (arr2.length)+1;
- int result[]=new int[size];
- int carry=0;
- for(int i=(arr1.length)-1; i>0;i--){}
- return(result);
- }
- public static void main(String[] args) {
- int arr1[]={1,2,3,4};
- int arr2[]={9,7};
- int arr3[]={9,9,9,9};
- int res[];
- res=add(arr1,arr2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement