write a program to add two numbers without using an arithmetic
operator.

Answer Posted / mogankumar pc

#include<stdio.h>
#include<conio.h>
int main()
{
int first,second;
printf("enter the two numbers");
scanf("%d%d",&first,&second);
first+= second;
printf("RESULT:%d",first);
getch();
return 0;
}
//+= is not arithmetic operator; its assignment operator

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c++ is not a pure oop language?

762


How can I disable the "echo" feature?

853


How does the copy constructor differ from the assignment operator (=)?

877


What is null and void pointer?

820


What is insertion sorting?

872


which of the following is not an secondary constant a) array b) real c) union

1552


What is an inclusion guard?

871


Do class declarations end with a semicolon? Do class method definitions?

876


What are the advantages of using a pointer?

837


What is pointer to member?

793


What is the difference between a declaration and a definition?

830


What is the use of structure in c++?

775


Name the operators that cannot be overloaded in C++?

817


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1966


What is the use of main function in c++?

762