The trouble is you think you have time. Your success depends on how you utilize your time.

C++ program which takes input and print square and cube of a number.

Write a C++ program which takes input of a number from user and print square and cube of that number.

#include<iostream>
using namespace std;
int main()
{ cout<<"www.moznum.blogspot.com"<<endl<<endl;

int x,square,cube;
cout << "Please enter a number: ";
cin >>x;
square = x*x;
cout << "Square of the number is " << square <<endl;
cube = x*x*x;
cout << "Cube of the number is " << cube <<endl;
return 0;
}

You can also Search this topic by:

7 comments:

  1. Thanks a lot. Tried this my self. Works great :)

    ReplyDelete
  2. It's very easy to understand...!!!
    Great job:-)

    ReplyDelete
  3. Aap ki website se ham ko boht zyda help milti hai..
    Bas 1 request hai.


    Plz agr aaap ke pas c++ ke manual solution ya phr koi book hai to muje mail kar dijiye....
    hassan.mughal0312@gmail.com

    ReplyDelete
  4. Nice website though u could have made it with Wordpress

    ReplyDelete
    Replies
    1. Thanks if you liked this site, Please share this to your friends.

      Delete