1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

what should be the output?

Discussion in 'C' started by Ankur Kamboj, Aug 2, 2011.

  1. Ankur Kamboj

    Ankur Kamboj New Member

    int DIMension(int array[]){
    return sizeof(array/sizeof(int);}
    main(){
    int arr[10];
    printf(“Array dimension is %d”,DIMension(arr));
    }
     
  2. kumar3749

    kumar3749 New Member

    Code:
    #include <stdio.h>
    #include<conio.h>
    void funarr(int arr[], int len)
    {
    printf("\nEnter the length of array :");
    scanf("%\nd",&len);
    printf("\nEnter the elements of the array :");
    for(i=0; i<len; i++)
    {
         scanf("%d",&arr[i]);
    }
    printf("\nThe elements of the array are as follows :");
    for(i=0; i<len; i++)
    {
        printf("\n%d",arr[i]);
    }
    }
    void main()
    {
    int myarr[100];
    clrscr();
    funarr(myarr, 7);
    getch();
    }
     
    Last edited by a moderator: Aug 2, 2011
  3. Ankur Kamboj

    Ankur Kamboj New Member



    o/p will be same as you give the input in the array.
     
  4. xpi0t0s

    xpi0t0s Mentor

    Why not grab yourself a compiler and try these things out?
     

Share This Page