How to add two numbers without using arithmetic operators?

Answer Posted / pakalapati vijaya rama raju

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

Is This Answer Correct ?    16 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why structure is used in c?

583


How can I write a function analogous to scanf?

648


Explain high-order bytes.

670


How do I convert a string to all upper or lower case?

624


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

1989






What is the purpose of sprintf?

615


Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer

3838


What do you mean by scope of a variable in c?

540


Why do we need a structure?

581


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2154


what do you mean by enumeration constant?

594


What is a program?

657


How old is c programming language?

571


How do I read the arrow keys? What about function keys?

610


What does printf does?

737