Subscribe To Our Newsletter

Sign Up Now To Get Free Coupon Codes, Event Coupon Codes Updates, Offers Updates. It's 100% Free!

We Hate Spam! Really, It's terrible and we never do it.

C++ | Modify variable and replace its values | Lecture 2

Variable:

Variable is certain type of variable which is liable to vary and change for specific purpose and according to its range.

Types of Variable:

Modify Variable And Replace Its Value:

In Lecture 2 you will learn about variable modification and replacement.
Once you define a variable you can easily use that for print out your data. as
mynumber = 55;  
cout << "My Number is = " << mynumber << endl;  
If you are thinking about
endl
endl (End Line), It is used to break the line.
As you know, why do we use
system("pause");
So we can stop our function anywhere and anytime. 
If you define a variable and show its value.
Again you replace another value to this same variable and again show its value. So, now its value will be changed because you have replaced its value. C++ or any other language always prefer to latest value.
You can also use addition, multiply or any mathematics rules for variables but you need to see its type.
Variable type is very important to describe. Variable is defined according to its range.

 /*  
  Name: Replace variable and modify value  
  Copyright: QWC.Me  
  Author: Samee Ullah Feroz  
  Date: 26/01/14 23:31  
  Description: Replace variable and modify value  
 */  
 #include <iostream>  
 int main()  
   {  
    using namespace std;  
    int mynumber; //we daclare mynumber is as variable and its type is integer.  
      mynumber = 55;  
      cout << "My Number is = ";  
      cout << mynumber << endl << "Please enter to show new value\n";  
      system("pause");  
      //replace variable  
      mynumber = 32;  
      cout << "My Number is = ";  
      cout << mynumber << endl << "Please enter to check addition of both values\n";  
      system("pause");  
      //again replace with arthmatics values.  
      mynumber = 32 + 55;  
      cout << "My Numbers addition is = ";  
      cout << mynumber << endl;  
    system("pause");  
    return 0;  
   }  
You can ask me any question regarding this lecture to Wizpert.

Download Free Perfect Uninstaller

Share this article :

Post a Comment

Give your reviews about this blog. Leave your comments. what do you think about this post?

Comments Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.

---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards

 
Support : | Internet Marketing Specialist And Business Developer
Copyright © 2013-2016. Samee Articles - All Rights Reserved
Proudly powered by Blogger