How to add two numbers without using arithmetic operators?

Answer Posted / ramanareddy

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the two numbers");
scanf("%d %d",%a,&b);
c=(-(-a-b));
printf("sum is = %d",c");
getch();
}

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does %c do in c?

591


What is string function in c?

544


How is a structure member accessed?

592


Can you please explain the scope of static variables?

608


difference between object file and executable file

6103






I need a sort of an approximate strcmp routine?

665


Why is c known as a mother language?

751


Explain pointers in c programming?

640


What is a nested loop?

653


Explain what are the different file extensions involved when programming in c?

639


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

2526


What is the difference between declaring a variable and defining a variable?

726


Can the curly brackets { } be used to enclose a single line of code?

719


How can I write a function analogous to scanf?

662


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

693