IT Community - Software Programming, Web Development and Technical Support

Add two numbers without using addition operator

This is a discussion on Add two numbers without using addition operator within the C and C++ Programming forums, part of the Software Development category; The following program will add two numbers without addtion operator Code: #include<stdio.h> void main() { int a,...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-31-2007, 08:15 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default Add two numbers without using addition operator

The following program will add two numbers without addtion operator

Code:
#include<stdio.h>
void main()
{
 int a,b,c;
 printf("Enter A value=");
 scanf("%d",&a);
 printf("Enter B value=");
 scanf("%d",&b);
 c=a-(-b);
 printf("Addition of A & B is =%d",c);
}

output

Code:

Enter A value=10
Enter B value=30

Addition of A & B is =40
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating Numbers ragavraj PHP Programming 1 11-07-2007 07:12 AM
Greatest of Three Numbers Without Using Two Variable Murali C and C++ Programming 1 10-29-2007 10:50 PM
Greatest of Three Numbers Without Using Relational Operator? velhari C and C++ Programming 4 10-25-2007 03:10 AM
Phone Numbers in SQL Server – Formatting Sundaram Database Support 0 09-21-2007 01:43 PM
How to Generate Various types of random numbers using SQLServer ? Archer Database Support 1 07-16-2007 02:26 AM


All times are GMT -7. The time now is 09:49 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0