Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ programming

C++ programming

Scheduled Pinned Locked Moved C / C++ / MFC
c++
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TanyaRaunak
    wrote on last edited by
    #1

    #include
    using namespace std;
    class calculate
    {
    private:
    int x,y;
    public:
    void input (int p, int q);
    {
    x=p;
    y=q;
    }
    void output()
    {
    cout<<"In sum=" <<(x+y);
    cout<<"In product" <<(x*y);
    }
    };

           main()
           {
         	calculate m;
         	m.input(60,40);
    	m.output();
    }
    
    V L 2 Replies Last reply
    0
    • T TanyaRaunak

      #include
      using namespace std;
      class calculate
      {
      private:
      int x,y;
      public:
      void input (int p, int q);
      {
      x=p;
      y=q;
      }
      void output()
      {
      cout<<"In sum=" <<(x+y);
      cout<<"In product" <<(x*y);
      }
      };

             main()
             {
           	calculate m;
           	m.input(60,40);
      	m.output();
      }
      
      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      And what??? :confused:

      1 Reply Last reply
      0
      • T TanyaRaunak

        #include
        using namespace std;
        class calculate
        {
        private:
        int x,y;
        public:
        void input (int p, int q);
        {
        x=p;
        y=q;
        }
        void output()
        {
        cout<<"In sum=" <<(x+y);
        cout<<"In product" <<(x*y);
        }
        };

               main()
               {
             	calculate m;
             	m.input(60,40);
        	m.output();
        }
        
        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Look at the line that gives the error message, or the one before it:

          void input (int p, int q); // what is this semi-colon doing here?
        

        {

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups