Output of the Program

0

#include <iostream.h>
main()
{
printf(“%d”, sqrt(36.0));
}

a)6 b)6.000 c)0

answr is given c.. y?

Ravi Garg edited question
    0
    Bharat Kul Ratan (anonymous)

    %d attempts to read the expected double value to integer type. that’s why it looks different. changing back to %f would give 6.00

    Bharat Kul Ratan answered
      0
      Tanusree Ray (anonymous)

      its coming 0 only..

      Tanusree Ray answered
        0
        Ashish Gaur (anonymous)

        Bharat Kul Ratan Let me rephrase the ques . . . why are these values generated .. . . .

        Ashish Gaur answered
          0
          Ashish Gaur (anonymous)

          Joel Shrey In which compiler are you compiling . . . .

          Ashish Gaur answered
            0
            Tanusree Ray (anonymous)

            turbo c.. Bharat Kul Ratan didnt ndrstnd ur xplanatn..

            Tanusree Ray answered
              Add image to editor add image from link

              Question stats

              • Active
              • Views1115 times
              • Answers10 answers
              • Followers1 follower
              Question and answer is powered by AnsPress