Home / C Programming / Typedef :: Find Output of Program

C Programming :: Typedef

  1. What will be the output of the program?

     #include 
    
      int main()
      {
         typedef int arr[5];   
         arr iarr = {1, 2, 3, 4, 5};      
         int i;  
         for(i=0; i4; i++)         
            printf("%d,", iarr[i]);     
         return 0; 
    } 
    

     

  2. A.

    1, 2, 3, 4

    B.

    1, 2, 3, 4, 5

    C.

    No output

    D.

    Error: Cannot use typedef with an array


  3. What will be the output of the program?

      #include
      int main()
      {  
         typedef int LONG;   
         LONG a=4;    
         LONG b=68;   
         float c=0;     
         c=b;     
         b+=a;    
         printf("%d,", b);     
         printf("%f\n", c); 
         return 0; 
    } 
    

  4. A.

    72, 68.000000

    B.

    72.000000, 68

    C.

    68.000000, 72.000000

    D.

    68, 72.000000