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 advantages of c language?
write a program to add two numbers of any size.....(remember any size)
what is ur strangth & weekness
0 Answers Cognizant, LG Soft, NetEnrich,
what is the difference between global variable & static variable declared out side all the function in the file.
What is structure of c program?
What is local and global variable in c?
What is c language and why we use it?
Sir i need notes for structure,functions,pointers in c language can you help me please
to find out the reverse digit of a given number
6 Answers Infosys, Microsoft, TCS, Wipro,
what is the different between data structure and data type?
Write a small C program to determine whether a machine's type is little-endian or big-endian.
swap two integer variables without using a third temporary variable?