how to add numbers without using arithmetic operators.
Answer Posted / lookog
int add2(int a,int b)
{int s;
char *p=(unsigned)a;
s=&p[b];
return(s);
}
The previous soln with int would not be accurate, as int
storage is platform dependent. char is 1 bytes mostly.p[b]
is equivalent to *(p+b) and already p=a has been set.
though result is coming for -1000,-1000, not sure what it
means physically(address of -2000 ?)
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is c is a low level language?
Can a function argument have default value?
How the c program is executed?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
largest Of three Number using without if condition?
Differentiate between declaring a variable and defining a variable?
How can I do peek and poke in c?
What is difference between %d and %i in c?
How do I determine whether a character is numeric, alphabetic, and so on?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Explain what will the preprocessor do for a program?
What is putchar() function?
Write a program to print factorial of given number without using recursion?
What's the best way of making my program efficient?
What does the message "automatic aggregate intialization is an ansi feature" mean?