Advertisements

debug please

#include <string>
#include <iostream>
using namespace std;

int main()
{
   
  
    int tempNumber, number1, number2, nonNumber; //Declaring the variables
    string string1, string2, tempString;
    float floatNumber; //Declaring the floatnumber
    string name; // Declaring the string name

    number1 = 50;  //setting the number1
    number2 = 30; //setting the number2
    string1 = “First”; //setting the string1
    string2 = “Second”; //setting the string2
    floatNumber = 15.45; //setting the floatNumber
    name = “Mitchell_Meyer”; //setting the name

    cout << “Please Enter a Number(1):” << number1 << endl; //output for number1
    cout << “Please Enter a Number(2):” << number2 << endl; //output for number2
    cout << “Please Enter a string(1):” << string1 << endl; //output for string1
    cout << “Please Enter a string(2):” << string2 << endl; //output for string2
    cout << “Time for the swap:…Right Now” << endl << endl; //output for time of swap

    tempNumber = number1;  //Setting swap for variables
    number1 = number2;  //Setting swap for variables
    number2 = tempNumber;  //Setting swap for variables
    tempString = string1;  //Setting swap for strings
    string1 = string2;  //Setting swap for strings
    string2 = tempString;  //Setting swap for strings

    cout <<“Number 1 is:” << number1 << endl;  // Displaying the swapped number
    cout <<“Number 2 is:” << number2 << endl;  // Displaying the swapped number
    cout <<“String 1 is:” << string1 << endl;  // Displaying the swapped string
    cout <<“String 2 is:” << string2 << endl;  // Displaying the swapped string

    system (“pause”);  //wait for any key to be pressed before exit
    return 0; //end of program
}

Advertisements

About Rant4u

A Revolution in Social Networking

Posted on February 9, 2012, in #basic c++, #c++, #programming, #rant-4u. Bookmark the permalink. Leave a comment.

Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: