How to add two numbers without using arithmetic operators?
Answer Posted / srinu
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,i,j,k=0;
printf("enter 2 numbers");
scanf("%d%d",&a,&b);
if(a>b)
{
k=b;
for(i=1;i<=a;i++)
k++;
}
else
{
k=a;
for(j=1;j<=b;j++)
k++;
}
printf("sum of 2 numbers is %d",k);
}
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
The statement, int(*x[]) () what does in indicate?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
Differentiate call by value and call by reference?
Why doesn't C support function overloading?
What are linked lists in c?
Give differences between - new and malloc() , delete and free() ?
What is the use of in c?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
What is the use of structure padding in c?
What is the purpose of & in scanf?
What is a program flowchart?
How can I pad a string to a known length?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What is fflush() function?