what's the output of this program ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sriya
    New Member
    • Feb 2008
    • 1

    what's the output of this program ?

    hi, this is vidya,
    i have a doubt regarding the output of this program
    Code:
    main()
    {
    int c;
    c=300*300/300;
    printf("%d",c);
    }
    the output is?
    Last edited by acoder; May 10 '13, 03:28 PM.
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Why can't you run it yourself?

    Comment

    • sicarie
      Recognized Expert Specialist
      • Nov 2006
      • 4677

      #3
      Originally posted by sriya
      hi, this is vidya,
      i have a doubt regarding the output of this program
      Code:
      main()
      {
      int c;
      c=300*300/300;
      printf("%d",c);
      }
      the output is?
      Nothing. That's not a complete program.
      Last edited by acoder; May 10 '13, 03:28 PM.

      Comment

      • gunner666
        New Member
        • Feb 2008
        • 3

        #4
        Im sorry to day this sriya....
        If u dont know wat the output of such a simple program is....
        Then i suggest u forget learnin C ,and move On....

        Comment

        • krishnabhargav
          New Member
          • Feb 2008
          • 24

          #5
          Originally posted by gunner666
          Im sorry to day this sriya....
          If u dont know wat the output of such a simple program is....
          Then i suggest u forget learnin C ,and move On....
          You should feel sorry....no one is expert in anything ... what is the output of this program...
          Code:
          #include<iostream>
          using namespace std;
          
          int main()
          {
            long quo = 24 * 60 * 60 * 1000;
            long div = 24 * 60 * 60 * 1000*1000;
          
            cout<<div/quo;
          }
          May be programming is new to her ...

          anyway, the above code is taken from a popular java puzzle.

          Comment

          • sicarie
            Recognized Expert Specialist
            • Nov 2006
            • 4677

            #6
            gunner666-

            That is not acceptable behavior on theScripts. While sriya might not know the output of basic programs, I'm willing to bet you didn't either until you learned what the basic IO and control structures were.

            So please confine yourself to helpful, or at least constructive criticisms.

            sicarie

            Comment

            • Geekibz
              New Member
              • Jan 2008
              • 12

              #7
              <removed>.Or is there more to it than just that?

              Comment

              • rajudo
                New Member
                • May 2013
                • 1

                #8
                81
                maximum integer length is - 32767 to 32768.

                Comment

                • lego13
                  New Member
                  • May 2013
                  • 3

                  #9
                  The output is 300 .

                  Comment

                  Working...