sir i wanted to know how we wap in c to add numbers without
using arithmetic operator in which digits are entered by
Answers were Sorted based on User's Feedback
Answer / niranjan vg
printf("\n Enter the numbers : ");
carry=a&b; // Produce a extra carry bit if present
carry<<=1; // shift for every iteration so
that it gets added with the next digit
sum=a^b; // perform Xor Operation
carry=a&b; // Calculate the new value for carry
printf("\n The sum is %d", sum);
|Is This Answer Correct ?||3 Yes||1 No|
When is a “switch” statement preferable over an “if” statement?
Write a simple code fragment that will check if a number is positive or negative.
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What's wrong with "char *p = malloc(10);" ?
What's a "sequence point"?
why wipro wase
what is difference b/w extern & volatile variable??
mplementation of stack using any programing language
c program to add and delete an element from circular queue using array
why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?
Explain what is the difference between #include and #include 'file' ?
Explain low-order bytes.