How to add two numbers without using arithmetic operators?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / abhishek shukla
what will be output of this programme?
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5;
clrscr();
a=a+(2,3,3,5,8,6);
printf("%d",a);
getch();
}
| Is This Answer Correct ? | 1 Yes | 6 No |
Answer / pugalarasu
int sum(int num1,int num2)
{
for(int i=0;i<num2;i++)
num1++;
return num1;
}
| Is This Answer Correct ? | 39 Yes | 50 No |
Answer / ranjith
#include<stdio.h>
main()
{
int a=5,b=4,c;
c=a||b;
printf("sum="+c);
}
| Is This Answer Correct ? | 2 Yes | 21 No |
Answer / suhas
# include <stdio.h>
main()
{
int a=8,b=2;
a|=b;
printf("sum="+a);
}
| Is This Answer Correct ? | 7 Yes | 43 No |
Answer / kavi
#include<stdio.h>
int a,b,c;
{
printf("enter the two values");
scanf("%d","%d",&a,&b);
c=a||b;
}
| Is This Answer Correct ? | 10 Yes | 80 No |
Answer / prashant
even this gives the same ans as the above program gives...
just every one plz check it and tell me
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c;
printf("enter the nos");
scanf("%d %d",&b,&c);
a= (b^c);
printf("%d",a);
return 0;
}
| Is This Answer Correct ? | 19 Yes | 114 No |
What are the uses of a pointer?
Why does everyone say not to use scanf? What should I use instead?
Write a program to swap two numbers without using a temporary variable?
How can we see the Expanded source code and compiled code for our source program in C?
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);
Can I pass constant values to functions which accept structure arguments?
How many levels of indirection in pointers can you have in a single declaration?
0 Answers Agilent, ZS Associates,
Who is the founder of c language?
main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : printf("A"); break; case 0 : printf("B"); break; default : printf("C"); break; }} while(i<3); }
4 Answers Vector, Vector India,
What is meaning of tree
write a program that will accept two integers and will implement division without using the division operator if the second value is an odd number and will implement multiplication without using multiplication operator if the second value is an even number.
Why are algorithms important in c program?