Login | Register




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Addition Operator [C++]
PostPosted: Wed Feb 10, 2010 3:01 am 
Site Admin
Joined: Sat Feb 06, 2010 11:13 pm
Posts: 19
Accepts two integers through keyboard, then adds and shows the sum of the two numbers.

Code:
#include <iostream>

using namespace std;

int main (int argc, char *argv[])
{
  int num1, num2, sum;
  cout<<"Enter Two Numbers to add...\n";
  cout<<"Enter 1st number: ";
  cin>>num1;
  cout<<"Enter 2nd Number: ";
  cin >> num2;
  sum = num1 + num2;
  printf("%d + %d = %d", num1,num2,sum);
  system("Pause");
  return 0;
}



Profile  Offline
 

Display posts from previous:  Sort by  

Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 1 guest

Panel

Top You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Search for:
Jump to:  
 cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Dizayn Ercan Koc