What is printed after execution of each of the following C-programs?

What is printed after execution of each of the following C-programs?

  1. void main()
    {f
    loat reals[5];
    *(reals+1) = 245.8;
    *reals = *(reals + 1);
    printf(“ %f”, reals[0] );
    }
  2. void main( )
    { int nums[3];
    int ptr = nums; nums[0] = 100; nums[1] = 1000; nums[2] = 10000; printf( “%d\n”, ++ptr );
    printf( “%d”, *ptr );
    }
  3. void main()
    { int digit =
    0;
    while (digit <= 9)
    printf( “%d\n”, digit++);
    }
  4. void main()
    { int a=7, b=6;
    fun1(a,b);
    printf(“\n a is %d b is %d”, a, b);
    }
    int fun1(int c,int d)
    { int e;
    e = c * d;
    d = 7 * c;
    printf(:\n c is %d d is %d e is %d”, c, d, e);
    return;
    }


Leave a Reply