write a program to compare 2 numbers without using logical
operators?
Answer Posted / jj
unsigned int is_same(unsigned int a, unsigned int b)
{
return (a / b);
}
int main()
{
unsigned int a, b;
a = 40, b = 40;
if ( is_same(a,b) == 1 )?
cout << "Equal" << endl
:
cout << "Not equal" << endl;
return 0;
}
| Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
Write a program with dynamically allocation of variable.
What is static memory allocation? Explain
Explain what is the difference between functions getch() and getche()?
How do we open a binary file in Read/Write mode in C?
Why is a semicolon (;) put at the end of every program statement?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
How is a pointer variable declared?
Write a program to show the change in position of a cursor using c
Explain goto?
Explain main function in c?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
What are reserved words with a programming language?
What are high level languages like C and FORTRAN also known as?
How do we declare variables in c?
Compare and contrast compilers from interpreters.