Developer community
0 votes
783 views
Write a c program to add two numbers without add operator?
asked by | 783 views

1 Answer

0 votes
Best answer
Use two subtract operators together to work as add operator.
 
#include <stdio.h>
#include <conio.h>
int main(){
          int a=1,b=2,c;
          c=a-(-b);
          printf(“%d”,c);
          getch();
          return 0;
}

 

answered by

Related questions

0 votes
1 answer
0 votes
1 answer
asked by keem Expert (13.2k points) 29 44 62 | 33.5k views
0 votes
1 answer
+1 vote
3 answers
asked by Smita Advisor (7.1k points) 11 23 42 | 6.8k views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

3,754 questions
4,046 answers
117 comments
10,709 users